instance

package
v0.2.1 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Apr 3, 2020 License: Apache-2.0 Imports: 8 Imported by: 1

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func GetAllSSMInstances

func GetAllSSMInstances(session ssmiface.SSMAPI, input *ssm.DescribeInstanceInformationInput, checkLatestAgent bool) (output []*ssm.InstanceInformation, err error)

GetAllSSMInstances takes an SSM session and an *ssm.DescribeInstanceInformationInput object, and calls getSSMInstances() to query the SSM API for information about a given SSM-managed EC2 instance. It also filters out any instances returned that are unresponsive to ping or not running Linux. Filtering can only be done based on either instance information OR instance tags for any given instance of a query. As such, filtering of instances by things like bamazon and env tags must be done after retrieving the instance information.

Types

type InstanceInfo

type InstanceInfo struct {
	InstanceID string
	Region     string
	Profile    string
	Tags       map[string]string
}

InstanceInfo is used to store information, including EC2 tags, about a particular instance

func (*InstanceInfo) FormatString

func (i *InstanceInfo) FormatString(includeTags ...string) string

FormatString returns a string with various information about a given instance

type InstanceInfoSafe

type InstanceInfoSafe struct {
	sync.Mutex
	AllInstances map[string]InstanceInfo
}

InstanceInfoSafe allows for concurrent-safe access to a map of InstanceInfo data

func (*InstanceInfoSafe) FormatStringSlice

func (i *InstanceInfoSafe) FormatStringSlice(includeTags ...string) (outSlice []string)

FormatStringSlice is used to return a strings preformatted to the correct width for selection prompts

type InstanceSlice

type InstanceSlice []string

InstanceSlice is the type of object passed to flag.Var() that holds AWS instance IDs

func (*InstanceSlice) Set

func (i *InstanceSlice) Set(value string) error

Set splits the provided comma-delimited list of instance IDs into an InstanceSlice, then sets the value of the caller to the new slice

func (*InstanceSlice) String

func (i *InstanceSlice) String() string

String() returns the string representation of an *InstanceSlice object

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL