aws

package
v0.9.5 Latest Latest
Warning

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

Go to latest
Published: Jan 21, 2021 License: Apache-2.0 Imports: 9 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func GetASGTagValue

func GetASGTagValue(asg *autoscaling.Group, key string) *string

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

func GetEC2TagValue

func GetEC2TagValue(ec2 *ec2.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.AutoScaling
	EC2Client *ec2.EC2
}

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

func GetAWSClients

func GetAWSClients() (*Clients, error)

GetAWSClients returns the AWS client objects we'll need

func (*Clients) ASGInstToEC2Inst

func (c *Clients) ASGInstToEC2Inst(inst *autoscaling.Instance) (*ec2.Instance, error)

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

func (Clients) ASGLTplVersionToEC2LTplVersion

func (c Clients) ASGLTplVersionToEC2LTplVersion(asgLaunchTemplate *autoscaling.LaunchTemplateSpecification) (*string, error)

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

func (*Clients) CompleteLifecycleAction

func (c *Clients) CompleteLifecycleAction(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(asgName *string) (*autoscaling.Group, error)

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

func (*Clients) GetAllASGs

func (c *Clients) GetAllASGs() ([]*autoscaling.Group, error)

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

func (*Clients) GetLaunchConfiguration

func (c *Clients) GetLaunchConfiguration(asg *autoscaling.Group) (*autoscaling.LaunchConfiguration, error)

GetLaunchConfiguration returns the LC object of the given ASG

func (*Clients) GetLaunchTemplateSpec

func (c *Clients) GetLaunchTemplateSpec(asg *autoscaling.Group) *autoscaling.LaunchTemplateSpecification

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

func (*Clients) GetUserData

func (c *Clients) GetUserData(inst *autoscaling.Instance) (*string, error)

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

func (*Clients) SetDesiredCapacity

func (c *Clients) SetDesiredCapacity(asg *autoscaling.Group, desiredCapacity *int64) error

SetDesiredCapacity sets the desired capacity of given ASG to given value

func (*Clients) TerminateInstanceInASG

func (c *Clients) TerminateInstanceInASG(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