I want to determine why my Auto Scaling group scaled down.
Scale-downs can be triggered by configured scale-down policies, scheduled scaling, or they can be user initiated. Whenever a scale-down occurs, an instance is terminated according to the configured termination policy.
View your Auto Scaling group scaling history in the AWS Management Console, through the use of the AWS Command Line Interface (AWS CLI), or the AWS API, as described below:
Policy-based Scale Down
If your Auto Scaling group scales down as a result of a scale-down policy, you'll see a message similar to the following in the scaling history:
At 2016-05-08T13:55:14Z a monitor alarm My-Scale-Down-Alarm in state ALARM triggered policy Decrease Group Size changing the desired capacity from 4 to 3.
You can adjust your Auto Scaling group scaling policy using the AWS Management Console or with the AWS CLI put-scaling-policy command. To configure when a scale-down occurs, adjust the associated Amazon CloudWatch alarm, or create a new alarm and then associate the new alarm with the Auto Scaling group scaling policy.
User-initiated Scale Down
A scale-down triggered by a user displays an event similar to the following in the scaling history:
At 2016-05-13T15:03:47Z a user request update of AutoScalingGroup constraints to min: 12, max: 20, desired: 13 changing the desired capacity from 14 to 13.
You can determine the user that made the API call by viewing your AWS CloudTrail logs.
Note: CloudTrail must be configured and enabled before you can begin recording API calls.
A scale-down initiated by a scheduled scale down action displays an event similar to the following in the scaling history:
At 2016-02-12T16:01:25Z a scheduled action update of AutoScalingGroup constraints to min: 1, max: 5, desired: 2 changing the desired capacity from 3 to 2. At 2016-02-12T16:01:25Z the scheduled action ScaleDown executed. Setting max size from 1 to 5. Setting desired capacity from 3 to 2.
Scheduled scaling can be configured using the AWS CLI. To view scheduled scaling, run the following command from the AWS CLI, substituting the appropriate value for MY-ASG-NAME:
aws autoscaling describe-scheduled-actions --auto-scaling-group-name MY-ASG-NAME
For more information about schedule-based auto-scaling see Scheduled Scaling.