invocation

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: 7 Imported by: 1

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func GetCommandInvocationResult

func GetCommandInvocationResult(context ssmiface.SSMAPI, jobs ...*ssm.SendCommandOutput) (invocationStatus []*ssm.GetCommandInvocationOutput, err error)

GetCommandInvocationResult takes an SSM context and any number of *ssm.SendCommandOutput objects and iterates through them until the invocation is complete. Each invocation is checked concurrently, but the method as a whole is blocking until all invocations have returned a finishing result, whether successful or not.

func RunSSMCommand

func RunSSMCommand(session ssmiface.SSMAPI, params *RunShellScriptParameters, dryRunFlag bool, resultChan chan *ssm.SendCommandOutput, errChan chan error, instanceID ...string)

RunSSMCommand uses an SSM session, pre-defined SSM document parameters, the dry run flag, and any number of instance IDs and executes the given command using the AWS-RunShellScript SSM document. It returns an *ssm.SendCommandOutput object, which contains the execution ID of the command, which we use to check the progress/status of the invocation.

Types

type CommandOutputSafe

type CommandOutputSafe struct {
	sync.Mutex
	Output []*ssm.SendCommandOutput
}

CommandOutputSafe allows for concurrent-safe access to a slice of *ssm.SendCommandOutput info

type Result

type Result struct {
	InvocationResult *ssm.GetCommandInvocationOutput
	ProfileName      string
	Region           string
	Status           string
}

Result is used to store information about an invocation run on a particular instance

type ResultSafe

type ResultSafe struct {
	sync.Mutex
	InvocationResults []*Result
}

ResultSafe allows for concurrent-safe access to a slice of InvocationResult info

type RunShellScriptParameters

type RunShellScriptParameters map[string][]*string

RunShellScriptParameters is the appropriate struct for use when setting SSM document parameters

Jump to

Keyboard shortcuts

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