autoscaling

package
v0.0.10 Latest Latest
Warning

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

Go to latest
Published: Feb 17, 2021 License: Apache-2.0 Imports: 7 Imported by: 0

Documentation

Index

Constants

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

	// InstanceTerminatingWaitStatus describes EC2 instance termination:wait status
	InstanceTerminatingWaitStatus = "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) IsTerminatingWait added in v0.0.7

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

IsTerminatingWait returns true if the provided status is in terminating:wait 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

func (*Options) String added in v0.0.10

func (o *Options) String() string

Jump to

Keyboard shortcuts

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