Documentation ¶
Index ¶
- type CommandOutput
- type Instance
- type Manager
- func (m *Manager) AbortCommand(instanceIds []string, commandID string) error
- func (m *Manager) GetCommandOutput(ctx context.Context, instanceIds []string, commandID string, ...)
- func (m *Manager) ListInstances(limit int64, tagFilters []*TagFilter) ([]*Instance, error)
- func (m *Manager) RunCommand(instanceIds []string, command string) (string, error)
- type MockEC2
- type MockS3
- type MockSSM
- func (mock *MockSSM) CancelCommand(input *ssm.CancelCommandInput) (*ssm.CancelCommandOutput, error)
- func (mock *MockSSM) DescribeInstanceInformation(input *ssm.DescribeInstanceInformationInput) (*ssm.DescribeInstanceInformationOutput, error)
- func (mock *MockSSM) GetCommandInvocation(input *ssm.GetCommandInvocationInput) (*ssm.GetCommandInvocationOutput, error)
- func (mock *MockSSM) SendCommand(input *ssm.SendCommandInput) (*ssm.SendCommandOutput, error)
- type TagFilter
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type CommandOutput ¶
CommandOutput is the return type transmitted over a channel when fetching output.
type Instance ¶
type Instance struct { InstanceID string `json:"instanceId"` Name string `json:"name"` State string `json:"state"` ImageID string `json:"imageId"` PlatformName string `json:"platformName"` PlatformVersion string `json:"platformVersion"` IPAddress string `json:"ipAddress"` PingStatus string `json:"pingStatus"` LastPingDateTime time.Time `json:"lastPingDateTime"` }
Instance describes relevant information about an instance-id as collected from SSM and EC2 endpoints. And does not user pointers for all values.
func NewInstance ¶
func NewInstance(ssmInstance *ssm.InstanceInformation, ec2Instance *ec2.Instance) *Instance
NewInstance creates a new Instance from ssm.InstanceInformation.
type Manager ¶
type Manager struct {
// contains filtered or unexported fields
}
Manager handles the clients interfacing with AWS.
func NewManager ¶
NewManager creates a new Manager from an AWS session and region.
func NewTestManager ¶
NewTestManager creates a new manager for testing purposes.
func (*Manager) AbortCommand ¶
AbortCommand command on the given instance ids.
func (*Manager) GetCommandOutput ¶
func (m *Manager) GetCommandOutput(ctx context.Context, instanceIds []string, commandID string, out chan<- *CommandOutput)
GetCommandOutput fetches the results from a command invocation for all specified instanceIds and closes the receiving channel before exiting.
func (*Manager) ListInstances ¶
ListInstances fetches a list of instances managed by SSM. Paginates until all responses have been collected.
type MockEC2 ¶ added in v0.2.2
func (*MockEC2) DescribeInstances ¶ added in v0.2.2
func (mock *MockEC2) DescribeInstances(input *ec2.DescribeInstancesInput) (*ec2.DescribeInstancesOutput, error)
type MockS3 ¶
func (*MockS3) GetObject ¶
func (mock *MockS3) GetObject(input *s3.GetObjectInput) (*s3.GetObjectOutput, error)
type MockSSM ¶
type MockSSM struct { ssmiface.SSMAPI Instances []*ssm.InstanceInformation NextToken string CommandStatus string CommandHistory map[string]*struct { Command *ssm.Command Status string } Error bool // contains filtered or unexported fields }
func (*MockSSM) CancelCommand ¶
func (mock *MockSSM) CancelCommand(input *ssm.CancelCommandInput) (*ssm.CancelCommandOutput, error)
func (*MockSSM) DescribeInstanceInformation ¶
func (mock *MockSSM) DescribeInstanceInformation(input *ssm.DescribeInstanceInformationInput) (*ssm.DescribeInstanceInformationOutput, error)
func (*MockSSM) GetCommandInvocation ¶
func (mock *MockSSM) GetCommandInvocation(input *ssm.GetCommandInvocationInput) (*ssm.GetCommandInvocationOutput, error)
func (*MockSSM) SendCommand ¶
func (mock *MockSSM) SendCommand(input *ssm.SendCommandInput) (*ssm.SendCommandOutput, error)