aws

package
v0.0.12 Latest Latest
Warning

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

Go to latest
Published: Dec 30, 2019 License: LGPL-3.0 Imports: 7 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func FilterAutoScalingGroupByTag

func FilterAutoScalingGroupByTag(TagKey string, TagValue string, autoScalingGroups []*aws.Group) *aws.Group

FilterAutoScalingGroupByTag filters the given AutoScalingGroups by the given tag (key-value pair). In case none of the AutoScalingGroups has the specified tag-key and tag-value nil is returned. If multiple AutoScalingGroups match the specified tag-key/ -value, only the first one is returned.

func GetAutoScalingGroups

func GetAutoScalingGroups(autoScaling iface.AutoScaling) ([]*aws.Group, error)

GetAutoScalingGroups obtains all AutoScalingGroup's

func MonitorInstanceScaling

func MonitorInstanceScaling(autoScaling iface.AutoScaling, autoScalingGroupName string, activityID string, timeout time.Duration) (uint, error)

MonitorInstanceScaling will block until the instance is scaled up/ down The function returns the number of iterations that where needed to monitor the scaling of the instance

func NewAWSSession

func NewAWSSession(region string) (*session.Session, error)

NewAWSSession creates a new session needed for interaction with the aws api

func NewAWSSessionFromProfile

func NewAWSSessionFromProfile(profile string) (*session.Session, error)

NewAWSSessionFromProfile creates a new session needed for interaction with the aws api. Here a profile can be specified.

func TerminateInstanceInAsg

func TerminateInstanceInAsg(autoScaling iface.AutoScaling, instanceID string) (asgName string, activityID string, err error)

TerminateInstanceInAsg removes the specified instance and decrements the desired capacity of the instance accordingly.

Types

type AutoScalingFactoryImpl

type AutoScalingFactoryImpl struct {
}

AutoScalingFactoryImpl implementation of a factory that can create an objects used for auto scaling AWS ASG's

func (*AutoScalingFactoryImpl) CreateAutoScaling

func (asf *AutoScalingFactoryImpl) CreateAutoScaling(session *session.Session) iface.AutoScaling

CreateAutoScaling creates an object used for auto scaling AWS ASG's

type AutoScalingGroupQuery

type AutoScalingGroupQuery struct {

	// AsgIF is the interface to aws used to query information about AutoScalingGroup's
	AsgIF iface.AutoScaling

	// TagKey is the name of the tag that should be used to find the ASG
	TagKey string
	// TagValue is the value of the tag that should be used to find the ASG
	TagValue string
}

AutoScalingGroupQuery structure to build queries to the AWS ASG API

func (*AutoScalingGroupQuery) GetAutoScalingGroupName

func (asgQ *AutoScalingGroupQuery) GetAutoScalingGroupName() (string, error)

GetAutoScalingGroupName returns the name of the AutoScalingGroup specified by the AutoScalingGroupQuery.

func (*AutoScalingGroupQuery) GetScaleNumbers

func (asgQ *AutoScalingGroupQuery) GetScaleNumbers() (minCount uint, desiredCount uint, maxCount uint, err error)

GetScaleNumbers returns the numbers reflecting the scale of the AutoScalingGroup specified by the AutoScalingGroupQuery.

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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