ec2

package
v0.0.0-...-208b0ff Latest Latest
Warning

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

Go to latest
Published: Oct 28, 2019 License: MIT Imports: 9 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type EC2

type EC2 struct {
	Instances []*autoscaling.Instance
	Config    *config.Config
	// contains filtered or unexported fields
}

EC2 encapsulates methods for curating chaos on AWS EC2 instances within an autoscaling group.

func New

func New(c *config.Config) (*EC2, error)

New creates a new EC2 service client.

func (*EC2) Chew

func (e *EC2) Chew() error

Chew terminates EC2 instances within the configured Auto Scaling group.

func (*EC2) DescribeASG

func (e *EC2) DescribeASG() error

DescribeASG retrives all of the instances within the configured Auto Scaling Group (ASG). This includes all of their metadata. The instances within the ASG are then assigned to the current instances `Instances` slice for use by the `TerminateInstances` method. See https://docs.aws.amazon.com/sdk-for-go/api/service/autoscaling/#Instance

func (*EC2) Name

func (e *EC2) Name() string

Name returns the canonical name of EC2.

func (*EC2) TerminateInstances

func (e *EC2) TerminateInstances() ([]*ec2.InstanceStateChange, error)

TerminateInstances uses the returned instance metadata and the user's configuration, to terminate the instances within the configured Auto Scaling Group. NOTE: The API accepts 1000 instance IDs at max.

Jump to

Keyboard shortcuts

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