Wondering how to set EC2 scale down of Auto Scaling group without intervention? We can help you.
During a scale-down, an instance terminates according to the configured termination policy.
Here, at Bobcares, we assist our customers with several AWS queries as part of our AWS Support Services.
Today, let us discuss Scale-downs.
EC2 scale down of Auto Scaling group without intervention
In order to view the Auto Scaling group scaling history in the Amazon EC2 console, we can use the AWS CLI, or the AWS API.
However, to avoid unnecessary errors we need to have the most recent version of the AWS CLI.
Moving ahead, our Support Techs introduces different types of scale-downs and how we can adjust them.
Policy-based scale down
It is possible for the Auto Scaling group scales down because of a scale-down policy.
In such a case, we receive 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.
We can adjust the policy via the Amazon EC2 console or with the AWS CLI put-scaling-policy command.
We can configure when a scale-down occurs.
To do so, we adjust the associated Amazon CloudWatch alarm. Or, we create a new alarm and then associate the new alarm with the Auto Scaling group scaling policy.
User-initiated scale down
At times, a scale-down can trigger by a user. This displays an event similar to the following:
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.
To determine the user that made the API call, we view the AWS CloudTrail logs.
However, we need to ensure to configure and enable CloudTrail to record API calls.
Another one is a scale-down initiated by a scheduled scale-down action.
This will display an event similar to the following:
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.
To view scheduled scaling using the AWS CLI, we run the following command.
Here, we need to replace the MY-ASG-NAME with the Auto Scaling group name.
aws autoscaling describe-scheduled-actions --auto-scaling-group-name MY-ASG-NAME
It is also possible to view and manage scheduled scaling using the Amazon EC2 console.
[Need help with the set up? We’d be happy to assist]
In short, we saw how our Support Techs set scale downs without intervention.