func GetRegionSSMInstances(region string, ssmInstList *SSMInstances, search string) error {
	sess := session.Must(session.NewSession(&aws.Config{Region: aws.String(region)}))
	svc := ssm.New(sess)
	result, err := svc.DescribeInstanceInformation(&ssm.DescribeInstanceInformationInput{})
	if err != nil {
		return err
	}
	instList := new(Instances)
	GetRegionInstances(region, instList, "", true)
	instances := make(SSMInstances, len(result.InstanceInformationList))
	for i, inst := range result.InstanceInformationList {
		instances[i].Marshal(inst, region, instList)
	}
	if search != "" {
		term := regexp.MustCompile(search)
	Loop:
		for i, in := range instances {
			rInst := reflect.ValueOf(in)
			for k := 0; k < rInst.NumField(); k++ {
				sVal := rInst.Field(k).String()
				if term.MatchString(sVal) {
					*ssmInstList = append(*ssmInstList, instances[i])
					continue Loop
				}
			}
		}
	} else {
		*ssmInstList = append(*ssmInstList, instances[:]...)
	}
	return nil
}
GetRegionSSMInstances returns a slice of Instances into the passed Instances slice based on the provided region and search term, and optional running flag
package aws
import (
	"errors"
	"fmt"
	"os"
	"reflect"
	"regexp"
	"strings"
	"sync"
	"time"
	"github.com/aws/aws-sdk-go/aws"
	"github.com/aws/aws-sdk-go/aws/session"
	"github.com/aws/aws-sdk-go/service/ssm"
	humanize "github.com/dustin/go-humanize"
	"github.com/murdinc/awsm/models"
	"github.com/murdinc/terminal"
	"github.com/olekukonko/tablewriter"
)
var ssmRegions = []string{
	"us-east-1", "us-east-2", "us-west-1", "us-west-2",
	"ap-southeast-1", "ap-southeast-2", "ap-northeast-1",
	"ap-northeast-2", "eu-central-1", "eu-west-1", "sa-east-1",
}
type Inventory []Entity
type Entity models.Entity
type SSMInstances []SSMInstance
type SSMInstance models.SSMInstance
type CommandInvocations []CommandInvocation
type CommandInvocation models.CommandInvocation
type CommandPlugins []CommandPlugin
type CommandPlugin models.CommandPlugin
func GetSSMInstanceById(region, id string) (SSMInstance, error) {
	sess := session.Must(session.NewSession(&aws.Config{Region: aws.String(region)}))
	svc := ssm.New(sess)
	params := &ssm.DescribeInstanceInformationInput{
		InstanceInformationFilterList: []*ssm.InstanceInformationFilter{
			{
				Key: aws.String("InstanceIds"),
				ValueSet: []*string{
					aws.String(id),
				},
			},
		},
	}
	result, err := svc.DescribeInstanceInformation(params)
	if err != nil {
		return SSMInstance{}, err
	}
	if len(result.InstanceInformationList) == 0 {
		return SSMInstance{}, errors.New("No SSM Instances found matching instance ID [" + id + "] in [" + region + "].")
	}
	instList := new(Instances)
	GetRegionInstances(region, instList, "", true)
	instances := make(SSMInstances, len(result.InstanceInformationList))
	for i, inst := range result.InstanceInformationList {
		instances[i].Marshal(inst, region, instList)
	}
	return instances[0], err
}
func GetSSMInstances(search string) (*SSMInstances, []error) {
	var wg sync.WaitGroup
	var errs []error
	ssmInstList := new(SSMInstances)
	for _, region := range ssmRegions {
		wg.Add(1)
		go func(region string) {
			defer wg.Done()
			err := GetRegionSSMInstances(region, ssmInstList, search)
			if err != nil {
				terminal.ShowErrorMessage(fmt.Sprintf("Error gathering instance list for region [%s]", region), err.Error())
				errs = append(errs, err)
			}
		}(region)
	}
	wg.Wait()
	return ssmInstList, errs
}