awsec2

package
v0.0.0-...-d983439 Latest Latest
Warning

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

Go to latest
Published: Dec 24, 2024 License: Apache-2.0 Imports: 25 Imported by: 2

Documentation

Index

Constants

View Source
const (
	SSMLinuxShellScript = "AWS-RunShellScript"
	SSMPowerShellScript = "AWS-RunPowerShellScript"
)
View Source
const DefaultRegion string = "us-east-1"

Variables

This section is empty.

Functions

This section is empty.

Types

type AwsCreds

type AwsCreds struct {
	AccessKeyId     string
	SecretAccessKey string
	ArnRole         string
	SessionToken    string
	Region          string
}

func New

func New(awsCreds AwsCreds) *AwsCreds

New instantiates a new AWS session and returns the API client

func (*AwsCreds) GetAccountAlias

func (creds *AwsCreds) GetAccountAlias(ctx context.Context) (string, error)

func (*AwsCreds) GetAccountID

func (creds *AwsCreds) GetAccountID(ctx context.Context) (string, error)

func (*AwsCreds) GetRegions

func (creds *AwsCreds) GetRegions(ctx context.Context) ([]string, error)

GetRegions returns a list of the names of AWS regions visible to this set of AWS credentials.

func (*AwsCreds) QueryField

func (client *AwsCreds) QueryField(ctx context.Context, nodesFilters []*common.Filter, field string) ([]string, error)

QueryField returns node fields(tags, tags:environment, regions)

func (*AwsCreds) QueryNodes

func (client *AwsCreds) QueryNodes(ctx context.Context, nodesFilters []*common.Filter, ssm bool) (map[string][]*manager.ManagerNode, error)

QueryNodes returns nodes based on a map of filters

func (*AwsCreds) QueryStatus

func (client *AwsCreds) QueryStatus(ctx context.Context, regions []string) ([]pgdb.InstanceState, error)

QueryStatus returns an array of instanceState based on regions and instanceIds given to it

func (*AwsCreds) TestConnectivity

func (creds *AwsCreds) TestConnectivity(ctx context.Context) error

TestConnectivity tests if we can reach AWS and can get regions and nodes

type SSM

type SSM struct {
}

func NewSSM

func NewSSM() *SSM

func (*SSM) GetCommandStatus

func (s *SSM) GetCommandStatus(ctx context.Context, commandID string, region string) (string, string, error)

func (*SSM) Send

func (s *SSM) Send(ctx context.Context, job *types.InspecJob, script string, scriptType string) (*ssm.SendCommandOutput, error)

func (*SSM) SendSSMJob

func (s *SSM) SendSSMJob(ctx context.Context, job *types.InspecJob, script string, scriptType string) error

Jump to

Keyboard shortcuts

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