2015/07/07 - Auto Scaling - 8 updated api methods
{'PolicyTypes': ['string']}Response
{'ScalingPolicies': {'EstimatedInstanceWarmup': 'integer', 'MetricAggregationType': 'string', 'MinAdjustmentMagnitude': 'integer', 'PolicyType': 'string', 'StepAdjustments': [{'MetricIntervalLowerBound': 'double', 'MetricIntervalUpperBound': 'double', 'ScalingAdjustment': 'integer'}]}}
Describes the policies for the specified Auto Scaling group.
Request Syntax
client.describe_policies( AutoScalingGroupName='string', PolicyNames=[ 'string', ], PolicyTypes=[ 'string', ], NextToken='string', MaxRecords=123 )
string
The name of the group.
list
One or more policy names or policy ARNs to be described. If you omit this list, all policy names are described. If an group name is provided, the results are limited to that group. This list is limited to 50 items. If you specify an unknown policy name, it is ignored with no error.
(string) --
list
One or more policy types. Valid values are SimpleScaling and StepScaling.
(string) --
string
The token for the next set of items to return. (You received this token from a previous call.)
integer
The maximum number of items to be returned with each call.
dict
Response Syntax
{ 'ScalingPolicies': [ { 'AutoScalingGroupName': 'string', 'PolicyName': 'string', 'PolicyARN': 'string', 'PolicyType': 'string', 'AdjustmentType': 'string', 'MinAdjustmentStep': 123, 'MinAdjustmentMagnitude': 123, 'ScalingAdjustment': 123, 'Cooldown': 123, 'StepAdjustments': [ { 'MetricIntervalLowerBound': 123.0, 'MetricIntervalUpperBound': 123.0, 'ScalingAdjustment': 123 }, ], 'MetricAggregationType': 'string', 'EstimatedInstanceWarmup': 123, 'Alarms': [ { 'AlarmName': 'string', 'AlarmARN': 'string' }, ] }, ], 'NextToken': 'string' }
Response Structure
(dict) --
ScalingPolicies (list) --
The scaling policies.
(dict) --
Describes a scaling policy.
AutoScalingGroupName (string) --
The name of the Auto Scaling group associated with this scaling policy.
PolicyName (string) --
The name of the scaling policy.
PolicyARN (string) --
The Amazon Resource Name (ARN) of the policy.
PolicyType (string) --
The policy type. Valid values are SimpleScaling and StepScaling.
AdjustmentType (string) --
The adjustment type, which specifies how ScalingAdjustment is interpreted. Valid values are ChangeInCapacity, ExactCapacity, and PercentChangeInCapacity.
MinAdjustmentStep (integer) --
Available for backward compatibility. Use MinAdjustmentMagnitude instead.
MinAdjustmentMagnitude (integer) --
The minimum number of instances to scale. If the value of AdjustmentType is PercentChangeInCapacity, the scaling policy changes the DesiredCapacity of the Auto Scaling group by at least this many instances. Otherwise, the error is ValidationError.
ScalingAdjustment (integer) --
The amount by which to scale, based on the specified adjustment type. A positive value adds to the current capacity while a negative number removes from the current capacity.
Cooldown (integer) --
The amount of time, in seconds, after a scaling activity completes before any further trigger-related scaling activities can start.
StepAdjustments (list) --
A set of adjustments that enable you to scale based on the size of the alarm breach.
(dict) --
Describes an adjustment based on the difference between the value of the aggregated CloudWatch metric and the breach threshold that you've defined for the alarm.
For the following examples, suppose that you have an alarm with a breach threshold of 50:
If you want the adjustment to be triggered when the metric is greater than or equal to 50 and less than 60, specify a lower bound of 0 and an upper bound of 10.
If you want the adjustment to be triggered when the metric is greater than 40 and less than or equal to 50, specify a lower bound of -10 and an upper bound of 0.
There are a few rules for the step adjustments for your step policy:
The ranges of your step adjustments can't overlap or have a gap.
At most one step adjustment can have a null lower bound. If one step adjustment has a negative lower bound, then there must be a step adjustment with a null lower bound.
At most one step adjustment can have a null upper bound. If one step adjustment has a positive upper bound, then there must be a step adjustment with a null upper bound.
The upper and lower bound can't be null in the same step adjustment.
MetricIntervalLowerBound (float) --
The lower bound for the difference between the alarm threshold and the CloudWatch metric. If the metric value is above the breach threshold, the lower bound is inclusive (the metric must be greater than or equal to the threshold plus the lower bound). Otherwise, it is exclusive (the metric must be greater than the threshold plus the lower bound). A null value indicates negative infinity.
MetricIntervalUpperBound (float) --
The upper bound for the difference between the alarm threshold and the CloudWatch metric. If the metric value is above the breach threshold, the upper bound is exclusive (the metric must be less than the threshold plus the upper bound). Otherwise, it is inclusive (the metric must be less than or equal to the threshold plus the upper bound). A null value indicates positive infinity.
The upper bound must be greater than the lower bound.
ScalingAdjustment (integer) --
The amount by which to scale, based on the specified adjustment type. A positive value adds to the current capacity while a negative number removes from the current capacity.
MetricAggregationType (string) --
The aggregation type for the CloudWatch metrics. Valid values are Minimum, Maximum, and Average.
EstimatedInstanceWarmup (integer) --
The estimated time, in seconds, until a newly launched instance can contribute to the CloudWatch metrics.
Alarms (list) --
The CloudWatch alarms related to the policy.
(dict) --
Describes an alarm.
AlarmName (string) --
The name of the alarm.
AlarmARN (string) --
The Amazon Resource Name (ARN) of the alarm.
NextToken (string) --
The token to use when requesting the next set of items. If there are no additional items to return, the string is empty.
{'Activities': {'StatusCode': {'WaitingForInstanceWarmup'}}}
Describes one or more scaling activities for the specified Auto Scaling group. If you omit the ActivityIds, the call returns all activities from the past six weeks. Activities are sorted by the start time. Activities still in progress appear first on the list.
Request Syntax
client.describe_scaling_activities( ActivityIds=[ 'string', ], AutoScalingGroupName='string', MaxRecords=123, NextToken='string' )
list
The activity IDs of the desired scaling activities. If this list is omitted, all activities are described. If the AutoScalingGroupName parameter is provided, the results are limited to that group. The list of requested activities cannot contain more than 50 items. If unknown activities are requested, they are ignored with no error.
(string) --
string
The name of the group.
integer
The maximum number of items to return with this call.
string
The token for the next set of items to return. (You received this token from a previous call.)
dict
Response Syntax
{ 'Activities': [ { 'ActivityId': 'string', 'AutoScalingGroupName': 'string', 'Description': 'string', 'Cause': 'string', 'StartTime': datetime(2015, 1, 1), 'EndTime': datetime(2015, 1, 1), 'StatusCode': 'WaitingForSpotInstanceRequestId'|'WaitingForSpotInstanceId'|'WaitingForInstanceId'|'PreInService'|'InProgress'|'WaitingForELBConnectionDraining'|'MidLifecycleAction'|'WaitingForInstanceWarmup'|'Successful'|'Failed'|'Cancelled', 'StatusMessage': 'string', 'Progress': 123, 'Details': 'string' }, ], 'NextToken': 'string' }
Response Structure
(dict) --
Activities (list) --
The scaling activities.
(dict) --
Describes scaling activity, which is a long-running process that represents a change to your Auto Scaling group, such as changing its size or replacing an instance.
ActivityId (string) --
The ID of the activity.
AutoScalingGroupName (string) --
The name of the Auto Scaling group.
Description (string) --
A friendly, more verbose description of the activity.
Cause (string) --
The reason the activity began.
StartTime (datetime) --
The start time of the activity.
EndTime (datetime) --
The end time of the activity.
StatusCode (string) --
The current status of the activity.
StatusMessage (string) --
A friendly, more verbose description of the activity status.
Progress (integer) --
A value between 0 and 100 that indicates the progress of the activity.
Details (string) --
The details about the activity.
NextToken (string) --
The token to use when requesting the next set of items. If there are no additional items to return, the string is empty.
{'Activities': {'StatusCode': {'WaitingForInstanceWarmup'}}}
Removes one or more instances from the specified Auto Scaling group. After the instances are detached, you can manage them independently from the rest of the Auto Scaling group.
For more information, see Detach EC2 Instances from Your Auto Scaling Group in the Auto Scaling Developer Guide.
Request Syntax
client.detach_instances( InstanceIds=[ 'string', ], AutoScalingGroupName='string', ShouldDecrementDesiredCapacity=True|False )
list
One or more instance IDs.
(string) --
string
[REQUIRED]
The name of the group.
boolean
[REQUIRED]
If True, the Auto Scaling group decrements the desired capacity value by the number of instances detached.
dict
Response Syntax
{ 'Activities': [ { 'ActivityId': 'string', 'AutoScalingGroupName': 'string', 'Description': 'string', 'Cause': 'string', 'StartTime': datetime(2015, 1, 1), 'EndTime': datetime(2015, 1, 1), 'StatusCode': 'WaitingForSpotInstanceRequestId'|'WaitingForSpotInstanceId'|'WaitingForInstanceId'|'PreInService'|'InProgress'|'WaitingForELBConnectionDraining'|'MidLifecycleAction'|'WaitingForInstanceWarmup'|'Successful'|'Failed'|'Cancelled', 'StatusMessage': 'string', 'Progress': 123, 'Details': 'string' }, ] }
Response Structure
(dict) --
Activities (list) --
The activities related to detaching the instances from the Auto Scaling group.
(dict) --
Describes scaling activity, which is a long-running process that represents a change to your Auto Scaling group, such as changing its size or replacing an instance.
ActivityId (string) --
The ID of the activity.
AutoScalingGroupName (string) --
The name of the Auto Scaling group.
Description (string) --
A friendly, more verbose description of the activity.
Cause (string) --
The reason the activity began.
StartTime (datetime) --
The start time of the activity.
EndTime (datetime) --
The end time of the activity.
StatusCode (string) --
The current status of the activity.
StatusMessage (string) --
A friendly, more verbose description of the activity status.
Progress (integer) --
A value between 0 and 100 that indicates the progress of the activity.
Details (string) --
The details about the activity.
{'Activities': {'StatusCode': {'WaitingForInstanceWarmup'}}}
Moves the specified instances into Standby mode.
For more information, see Auto Scaling InService State in the Auto Scaling Developer Guide.
Request Syntax
client.enter_standby( InstanceIds=[ 'string', ], AutoScalingGroupName='string', ShouldDecrementDesiredCapacity=True|False )
list
One or more instances to move into Standby mode. You must specify at least one instance ID.
(string) --
string
[REQUIRED]
The name of the Auto Scaling group.
boolean
[REQUIRED]
Specifies whether the instances moved to Standby mode count as part of the Auto Scaling group's desired capacity. If set, the desired capacity for the Auto Scaling group decrements by the number of instances moved to Standby mode.
dict
Response Syntax
{ 'Activities': [ { 'ActivityId': 'string', 'AutoScalingGroupName': 'string', 'Description': 'string', 'Cause': 'string', 'StartTime': datetime(2015, 1, 1), 'EndTime': datetime(2015, 1, 1), 'StatusCode': 'WaitingForSpotInstanceRequestId'|'WaitingForSpotInstanceId'|'WaitingForInstanceId'|'PreInService'|'InProgress'|'WaitingForELBConnectionDraining'|'MidLifecycleAction'|'WaitingForInstanceWarmup'|'Successful'|'Failed'|'Cancelled', 'StatusMessage': 'string', 'Progress': 123, 'Details': 'string' }, ] }
Response Structure
(dict) --
Activities (list) --
The activities related to moving instances into Standby mode.
(dict) --
Describes scaling activity, which is a long-running process that represents a change to your Auto Scaling group, such as changing its size or replacing an instance.
ActivityId (string) --
The ID of the activity.
AutoScalingGroupName (string) --
The name of the Auto Scaling group.
Description (string) --
A friendly, more verbose description of the activity.
Cause (string) --
The reason the activity began.
StartTime (datetime) --
The start time of the activity.
EndTime (datetime) --
The end time of the activity.
StatusCode (string) --
The current status of the activity.
StatusMessage (string) --
A friendly, more verbose description of the activity status.
Progress (integer) --
A value between 0 and 100 that indicates the progress of the activity.
Details (string) --
The details about the activity.
{'BreachThreshold': 'double', 'MetricValue': 'double'}
Executes the specified policy.
Request Syntax
client.execute_policy( AutoScalingGroupName='string', PolicyName='string', HonorCooldown=True|False, MetricValue=123.0, BreachThreshold=123.0 )
string
The name or Amazon Resource Name (ARN) of the Auto Scaling group.
string
[REQUIRED]
The name or ARN of the policy.
boolean
If this parameter is true, Auto Scaling waits for the cooldown period to complete before executing the policy. Otherwise, Auto Scaling executes the policy without waiting for the cooldown period to complete.
This parameter is not supported if the policy type is StepScaling.
For more information, see Understanding Auto Scaling Cooldowns in the Auto Scaling Developer Guide.
float
The metric value to compare to BreachThreshold. This enables you to execute a policy of type StepScaling and determine which step adjustment to use. For example, if the breach threshold is 50 and you want to use a step adjustment with a lower bound of 0 and an upper bound of 10, you can set the metric value to 59.
If you specify a metric value that doesn't correspond to a step adjustment for the policy, the call returns an error.
This parameter is required if the policy type is StepScaling and not supported otherwise.
float
The breach threshold for the alarm.
This parameter is required if the policy type is StepScaling and not supported otherwise.
None
{'Activities': {'StatusCode': {'WaitingForInstanceWarmup'}}}
Moves the specified instances out of Standby mode.
For more information, see Auto Scaling InService State in the Auto Scaling Developer Guide.
Request Syntax
client.exit_standby( InstanceIds=[ 'string', ], AutoScalingGroupName='string' )
list
One or more instance IDs. You must specify at least one instance ID.
(string) --
string
[REQUIRED]
The name of the Auto Scaling group.
dict
Response Syntax
{ 'Activities': [ { 'ActivityId': 'string', 'AutoScalingGroupName': 'string', 'Description': 'string', 'Cause': 'string', 'StartTime': datetime(2015, 1, 1), 'EndTime': datetime(2015, 1, 1), 'StatusCode': 'WaitingForSpotInstanceRequestId'|'WaitingForSpotInstanceId'|'WaitingForInstanceId'|'PreInService'|'InProgress'|'WaitingForELBConnectionDraining'|'MidLifecycleAction'|'WaitingForInstanceWarmup'|'Successful'|'Failed'|'Cancelled', 'StatusMessage': 'string', 'Progress': 123, 'Details': 'string' }, ] }
Response Structure
(dict) --
Activities (list) --
The activities related to moving instances out of Standby mode.
(dict) --
Describes scaling activity, which is a long-running process that represents a change to your Auto Scaling group, such as changing its size or replacing an instance.
ActivityId (string) --
The ID of the activity.
AutoScalingGroupName (string) --
The name of the Auto Scaling group.
Description (string) --
A friendly, more verbose description of the activity.
Cause (string) --
The reason the activity began.
StartTime (datetime) --
The start time of the activity.
EndTime (datetime) --
The end time of the activity.
StatusCode (string) --
The current status of the activity.
StatusMessage (string) --
A friendly, more verbose description of the activity status.
Progress (integer) --
A value between 0 and 100 that indicates the progress of the activity.
Details (string) --
The details about the activity.
{'EstimatedInstanceWarmup': 'integer', 'MetricAggregationType': 'string', 'MinAdjustmentMagnitude': 'integer', 'PolicyType': 'string', 'StepAdjustments': [{'MetricIntervalLowerBound': 'double', 'MetricIntervalUpperBound': 'double', 'ScalingAdjustment': 'integer'}]}
Creates or updates a policy for an Auto Scaling group. To update an existing policy, use the existing policy name and set the parameters you want to change. Any existing parameter not changed in an update to an existing policy is not changed in this update request.
If you exceed your maximum limit of step adjustments, which by default is 20 per region, the call fails. For information about updating this limit, see AWS Service Limits in the Amazon Web Services General Reference.
Request Syntax
client.put_scaling_policy( AutoScalingGroupName='string', PolicyName='string', PolicyType='string', AdjustmentType='string', MinAdjustmentStep=123, MinAdjustmentMagnitude=123, ScalingAdjustment=123, Cooldown=123, MetricAggregationType='string', StepAdjustments=[ { 'MetricIntervalLowerBound': 123.0, 'MetricIntervalUpperBound': 123.0, 'ScalingAdjustment': 123 }, ], EstimatedInstanceWarmup=123 )
string
[REQUIRED]
The name or ARN of the group.
string
[REQUIRED]
The name of the policy.
string
The policy type. Valid values are SimpleScaling and StepScaling. If the policy type is null, the value is treated as SimpleScaling.
string
[REQUIRED]
The adjustment type. Valid values are ChangeInCapacity, ExactCapacity, and PercentChangeInCapacity.
For more information, see Dynamic Scaling in the Auto Scaling Developer Guide.
integer
Available for backward compatibility. Use MinAdjustmentMagnitude instead.
integer
The minimum number of instances to scale. If the value of AdjustmentType is PercentChangeInCapacity, the scaling policy changes the DesiredCapacity of the Auto Scaling group by at least this many instances. Otherwise, the error is ValidationError.
integer
The amount by which to scale, based on the specified adjustment type. A positive value adds to the current capacity while a negative number removes from the current capacity.
This parameter is required if the policy type is SimpleScaling and not supported otherwise.
integer
The amount of time, in seconds, after a scaling activity completes and before the next scaling activity can start. If this parameter is not specified, the default cooldown period for the group applies.
This parameter is not supported unless the policy type is SimpleScaling.
For more information, see Understanding Auto Scaling Cooldowns in the Auto Scaling Developer Guide.
string
The aggregation type for the CloudWatch metrics. Valid values are Minimum, Maximum, and Average. If the aggregation type is null, the value is treated as Average.
This parameter is not supported if the policy type is SimpleScaling.
list
A set of adjustments that enable you to scale based on the size of the alarm breach.
This parameter is required if the policy type is StepScaling and not supported otherwise.
(dict) --
Describes an adjustment based on the difference between the value of the aggregated CloudWatch metric and the breach threshold that you've defined for the alarm.
For the following examples, suppose that you have an alarm with a breach threshold of 50:
If you want the adjustment to be triggered when the metric is greater than or equal to 50 and less than 60, specify a lower bound of 0 and an upper bound of 10.
If you want the adjustment to be triggered when the metric is greater than 40 and less than or equal to 50, specify a lower bound of -10 and an upper bound of 0.
There are a few rules for the step adjustments for your step policy:
The ranges of your step adjustments can't overlap or have a gap.
At most one step adjustment can have a null lower bound. If one step adjustment has a negative lower bound, then there must be a step adjustment with a null lower bound.
At most one step adjustment can have a null upper bound. If one step adjustment has a positive upper bound, then there must be a step adjustment with a null upper bound.
The upper and lower bound can't be null in the same step adjustment.
MetricIntervalLowerBound (float) --
The lower bound for the difference between the alarm threshold and the CloudWatch metric. If the metric value is above the breach threshold, the lower bound is inclusive (the metric must be greater than or equal to the threshold plus the lower bound). Otherwise, it is exclusive (the metric must be greater than the threshold plus the lower bound). A null value indicates negative infinity.
MetricIntervalUpperBound (float) --
The upper bound for the difference between the alarm threshold and the CloudWatch metric. If the metric value is above the breach threshold, the upper bound is exclusive (the metric must be less than the threshold plus the upper bound). Otherwise, it is inclusive (the metric must be less than or equal to the threshold plus the upper bound). A null value indicates positive infinity.
The upper bound must be greater than the lower bound.
ScalingAdjustment (integer) -- [REQUIRED]
The amount by which to scale, based on the specified adjustment type. A positive value adds to the current capacity while a negative number removes from the current capacity.
integer
The estimated time, in seconds, until a newly launched instance can contribute to the CloudWatch metrics. The default is to use the value specified for the default cooldown period for the group.
This parameter is not supported if the policy type is SimpleScaling.
dict
Response Syntax
{ 'PolicyARN': 'string' }
Response Structure
(dict) --
PolicyARN (string) --
The Amazon Resource Name (ARN) of the policy.
{'Activity': {'StatusCode': {'WaitingForInstanceWarmup'}}}
Terminates the specified instance and optionally adjusts the desired group size.
This call simply makes a termination request. The instances is not terminated immediately.
Request Syntax
client.terminate_instance_in_auto_scaling_group( InstanceId='string', ShouldDecrementDesiredCapacity=True|False )
string
[REQUIRED]
The ID of the EC2 instance.
boolean
[REQUIRED]
If true, terminating this instance also decrements the size of the Auto Scaling group.
dict
Response Syntax
{ 'Activity': { 'ActivityId': 'string', 'AutoScalingGroupName': 'string', 'Description': 'string', 'Cause': 'string', 'StartTime': datetime(2015, 1, 1), 'EndTime': datetime(2015, 1, 1), 'StatusCode': 'WaitingForSpotInstanceRequestId'|'WaitingForSpotInstanceId'|'WaitingForInstanceId'|'PreInService'|'InProgress'|'WaitingForELBConnectionDraining'|'MidLifecycleAction'|'WaitingForInstanceWarmup'|'Successful'|'Failed'|'Cancelled', 'StatusMessage': 'string', 'Progress': 123, 'Details': 'string' } }
Response Structure
(dict) --
Activity (dict) --
A scaling activity.
ActivityId (string) --
The ID of the activity.
AutoScalingGroupName (string) --
The name of the Auto Scaling group.
Description (string) --
A friendly, more verbose description of the activity.
Cause (string) --
The reason the activity began.
StartTime (datetime) --
The start time of the activity.
EndTime (datetime) --
The end time of the activity.
StatusCode (string) --
The current status of the activity.
StatusMessage (string) --
A friendly, more verbose description of the activity status.
Progress (integer) --
A value between 0 and 100 that indicates the progress of the activity.
Details (string) --
The details about the activity.