autoscaling

package
v0.0.5 Latest Latest
Warning

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

Go to latest
Published: Sep 10, 2019 License: Apache-2.0 Imports: 5 Imported by: 0

Documentation

Index

Constants

View Source
const (
	// InstanceTerminatingStatus describes EC2 instance termination status
	InstanceTerminatingStatus = "Terminating:Wait"

	// LifecycleActionResultContinue describes ASG instance lifecycle continue result
	LifecycleActionResultContinue = "CONTINUE"
)

Variables

This section is empty.

Functions

This section is empty.

Types

type AutoScaling

type AutoScaling struct {
	AutoScaling autoscalingiface.AutoScalingAPI
	Options     *Options
}

AutoScaling type is a AWS EC2 AutoScaling API facade

func New

func New(session *session.Session, options *Options) *AutoScaling

New creates a new AutoScaling

func (*AutoScaling) GetInstanceStatusAndAutoScalingGroupName

func (a *AutoScaling) GetInstanceStatusAndAutoScalingGroupName(instanceID *string) (*string, *string, error)

GetInstanceStatusAndAutoScalingGroupName get an AWS EC2 instance status and its ASG name by instanceID

func (*AutoScaling) GetLifecycleHookName

func (a *AutoScaling) GetLifecycleHookName(autoScalingGroupName *string) (*string, error)

GetLifecycleHookName gets an AWS ASG lifecycle hook name by autoScalingGroupName

func (*AutoScaling) IsTerminating

func (a *AutoScaling) IsTerminating(status *string) bool

IsTerminating returns true if the provided status is in terminating state

func (*AutoScaling) SendNotification

func (a *AutoScaling) SendNotification(instanceID *string, autoScalingGroupName *string, lifecycleHookName *string) error

SendNotification sends a notification to AWS ASG using provided instanceID, autoScalingGroupName and lifecycleHookName

type Options

type Options struct {
	InstanceID     string
	Region         string
	Profile        string
	LoopSleepTime  time.Duration
	ShutdownSleep  time.Duration
	ForceLoopBreak bool
}

Options for AutoScaling

Jump to

Keyboard shortcuts

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