Documentation ¶
Index ¶
- func FilterAutoScalingGroupByTag(TagKey string, TagValue string, autoScalingGroups []*aws.Group) *aws.Group
- func GetAutoScalingGroups(autoScaling iface.AutoScaling) ([]*aws.Group, error)
- func MonitorInstanceScaling(autoScaling iface.AutoScaling, autoScalingGroupName string, activityID string, ...) (uint, error)
- func NewAWSSession(region string) (*session.Session, error)
- func NewAWSSessionFromProfile(profile string) (*session.Session, error)
- func TerminateInstanceInAsg(autoScaling iface.AutoScaling, instanceID string) (asgName string, activityID string, err error)
- type AutoScalingFactoryImpl
- type AutoScalingGroupQuery
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 ¶
NewAWSSession creates a new session needed for interaction with the aws api
func NewAWSSessionFromProfile ¶
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.