Documentation ¶
Index ¶
- type CommandOutput
- type DocumentDescription
- type DocumentIdentifier
- type DocumentParameter
- type Instance
- type Manager
- func (m *Manager) AbortCommand(instanceIds []string, commandID string) error
- func (m *Manager) DescribeDocument(name string) (*DocumentDescription, error)
- func (m *Manager) GetCommandOutput(ctx context.Context, instanceIds []string, commandID string, ...)
- func (m *Manager) ListDocuments(limit int64, documentFilters []*ssm.DocumentFilter) ([]*DocumentIdentifier, error)
- func (m *Manager) ListInstances(limit int64, tagFilters []*TagFilter) ([]*Instance, error)
- func (m *Manager) RunCommand(instanceIds []string, name string, parameters map[string]string) (string, error)
- type MockEC2
- type MockS3
- type MockSSM
- func (mock *MockSSM) CancelCommand(input *ssm.CancelCommandInput) (*ssm.CancelCommandOutput, error)
- func (mock *MockSSM) DescribeDocument(input *ssm.DescribeDocumentInput) (*ssm.DescribeDocumentOutput, error)
- func (mock *MockSSM) DescribeInstanceInformation(input *ssm.DescribeInstanceInformationInput) (*ssm.DescribeInstanceInformationOutput, error)
- func (mock *MockSSM) GetCommandInvocation(input *ssm.GetCommandInvocationInput) (*ssm.GetCommandInvocationOutput, error)
- func (mock *MockSSM) ListDocuments(input *ssm.ListDocumentsInput) (*ssm.ListDocumentsOutput, error)
- func (mock *MockSSM) SendCommand(input *ssm.SendCommandInput) (*ssm.SendCommandOutput, error)
- type Opts
- type TagFilter
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type CommandOutput ¶
type CommandOutput struct { InstanceID string Status string Output string OutputUrl string Error error }
CommandOutput is the return type transmitted over a channel when fetching output.
type DocumentDescription ¶ added in v1.0.0
type DocumentDescription struct { Name string `json:"name"` Description string `json:"description"` Owner string `json:"owner"` DocumentVersion string `json:"documentVersion"` DocumentFormat string `json:"documentFormat"` DocumentType string `json:"documentType"` SchemaVersion string `json:"schemaVersion"` TargetType string `json:"targetType"` Parameters []*DocumentParameter }
DocumentDescription describes relevant information about a SSM Document
func NewDocumentDescription ¶ added in v1.0.0
func NewDocumentDescription(ssmDocument *ssm.DocumentDescription) *DocumentDescription
NewDocumentDescription creates a new Document from ssm.DocumentIdentifier.
func (*DocumentDescription) ParametersTabString ¶ added in v1.0.0
func (d *DocumentDescription) ParametersTabString() string
ParametersTabString returns all parameter values separated by "\t|\t" for an document. Use with tabwriter to output a table of parameters.
func (*DocumentDescription) TabString ¶ added in v1.0.0
func (d *DocumentDescription) TabString() string
TabString returns all field values separated by "\t|\t" for an document. Use with tabwriter to output a table of documents.
type DocumentIdentifier ¶ added in v1.0.0
type DocumentIdentifier struct { Name string `json:"name"` Owner string `json:"owner"` DocumentVersion string `json:"documentVersion"` DocumentFormat string `json:"documentFormat"` DocumentType string `json:"documentType"` SchemaVersion string `json:"schemaVersion"` TargetType string `json:"targetType"` }
DocumentIdentifier describes relevant information about a SSM Document
func NewDocumentIdentifier ¶ added in v1.0.0
func NewDocumentIdentifier(ssmDocument *ssm.DocumentIdentifier) *DocumentIdentifier
NewDocumentIdentifier creates a new Document from ssm.DocumentIdentifier.
func (*DocumentIdentifier) TabString ¶ added in v1.0.0
func (d *DocumentIdentifier) TabString() string
TabString returns all field values separated by "\t|\t" for an document. Use with tabwriter to output a table of documents.
type DocumentParameter ¶ added in v1.0.0
DocumentParameter describes relevant information about a SSM Document Parameter
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) DescribeDocument ¶ added in v1.0.0
func (m *Manager) DescribeDocument(name string) (*DocumentDescription, error)
DescribeDocument lists information for a specific document managed by SSM.
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) ListDocuments ¶ added in v1.0.0
func (m *Manager) ListDocuments(limit int64, documentFilters []*ssm.DocumentFilter) ([]*DocumentIdentifier, error)
ListDocuments fetches a list of documents managed by SSM. Paginates until all responses have been collected.
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 Documents []*ssm.DocumentIdentifier DocumentDescription *ssm.DocumentDescription 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) DescribeDocument ¶ added in v1.0.0
func (mock *MockSSM) DescribeDocument(input *ssm.DescribeDocumentInput) (*ssm.DescribeDocumentOutput, 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) ListDocuments ¶ added in v1.0.0
func (mock *MockSSM) ListDocuments(input *ssm.ListDocumentsInput) (*ssm.ListDocumentsOutput, error)
func (*MockSSM) SendCommand ¶
func (mock *MockSSM) SendCommand(input *ssm.SendCommandInput) (*ssm.SendCommandOutput, error)