aws

package
v0.20.0 Latest Latest
Warning

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

Go to latest
Published: Jul 19, 2022 License: Apache-2.0 Imports: 14 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func GetASGTagValue

func GetASGTagValue(asg *at.AutoScalingGroup, key string) *string

GetASGTagValue returns a pointer to the value for the given tag key

func GetEC2TagValue

func GetEC2TagValue(ec2 *et.Instance, key string) *string

GetEC2TagValue returns a pointer to the value of the tag with the given key

Types

type Clients

type Clients struct {
	ASGClient *autoscaling.Client
	EC2Client *ec2.Client
}

Clients holds the clients for this account's invocation of the APIs we'll need

func GetAWSClients

func GetAWSClients(ctx context.Context) (*Clients, error)

GetAWSClients returns the AWS client objects we'll need

func (*Clients) ASGInstToEC2Inst

func (c *Clients) ASGInstToEC2Inst(ctx context.Context, inst at.Instance) (*et.Instance, error)

ASGInstToEC2Inst converts a *autoscaling.Instance to its corresponding *ec2.Instance

func (Clients) ASGLTplVersionToEC2LTplVersion

func (c Clients) ASGLTplVersionToEC2LTplVersion(ctx context.Context, asgLaunchTemplate *at.LaunchTemplateSpecification) (*string, error)

ASGLTplVersionToEC2LTplVersion resolves ASG Template Versions to its actual *int32 ec2LaunchTemplate Version

func (*Clients) CompleteLifecycleAction

func (c *Clients) CompleteLifecycleAction(ctx context.Context, asgName *string, instID *string, lifecycleHook *string, result *string) error

CompleteLifecycleAction calls https://docs.aws.amazon.com/cli/latest/reference/autoscaling/complete-lifecycle-action.html

func (*Clients) GetASG

func (c *Clients) GetASG(ctx context.Context, asgName string) (*at.AutoScalingGroup, error)

GetASG gets the *autoscaling.Group that matches for the name given

func (*Clients) GetAllASGs

func (c *Clients) GetAllASGs(ctx context.Context) ([]*at.AutoScalingGroup, error)

GetAllASGs returns all ASGs visible with your client, with no filters

func (*Clients) GetLaunchConfiguration

func (c *Clients) GetLaunchConfiguration(ctx context.Context, asg *at.AutoScalingGroup) (*at.LaunchConfiguration, error)

GetLaunchConfiguration returns the LC object of the given ASG

func (*Clients) GetLaunchTemplateSpec

func (c *Clients) GetLaunchTemplateSpec(asg *at.AutoScalingGroup) *at.LaunchTemplateSpecification

GetLaunchTemplateSpec returns the LT spec for a given ASG, if it has one

func (*Clients) GetUserData

func (c *Clients) GetUserData(ctx context.Context, inst *at.Instance) (*string, error)

GetUserData returns a pointer to the value of the instance's userdata

func (*Clients) SetDesiredCapacity

func (c *Clients) SetDesiredCapacity(ctx context.Context, asg *at.AutoScalingGroup, desiredCapacity *int32) error

SetDesiredCapacity sets the desired capacity of given ASG to given value

func (*Clients) TerminateInstanceInASG

func (c *Clients) TerminateInstanceInASG(ctx context.Context, instID *string, decrement *bool) error

TerminateInstanceInASG calls https://docs.aws.amazon.com/cli/latest/reference/autoscaling/terminate-instance-in-auto-scaling-group.html

Jump to

Keyboard shortcuts

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