Refreshing, Protecting and Troubleshooting Auto Scaling Groups
This lesson explains day-to-day Auto Scaling operations: rolling out new launch template versions, controlling which instances are removed, pausing processes for maintenance and fixing groups that fail to launch.
Learning outcomes
After completing this lesson, you will be able to:
- Roll out new versions with instance refresh.
- Use termination policies, scale-in protection and suspended processes.
- Troubleshoot launch failures from activity history.
Instance refresh
Instance refresh replaces instances in a group with ones launched from a new launch template version or configuration, in batches. The minimum healthy percentage (for example 90%) and optional maximum healthy percentage (above 100% launches new instances before terminating old ones) control capacity during the refresh. Checkpoints pause at chosen percentages to validate, skip matching leaves instances that already match the desired configuration, and auto rollback returns to the previous configuration if the refresh fails or CloudWatch alarms go into ALARM. It is the standard way to roll out a new AMI.
The following diagram shows a refresh paused at its checkpoint.

Termination policies, scale-in protection and suspended processes
When scaling in, the default termination policy first chooses the AZ with the most instances, then terminates instances using the oldest launch template or configuration, then those closest to the next billing hour. Other policies include OldestInstance, NewestInstance, OldestLaunchTemplate, AllocationStrategy and custom Lambda-based policies. Instance scale-in protection prevents specific instances being terminated on scale-in (not on health check replacement). Putting an instance into Standby removes it from service for troubleshooting while keeping it in the group. Suspending processes such as Launch, Terminate, HealthCheck, ReplaceUnhealthy, AZRebalance or AlarmNotification stops Auto Scaling from interfering during maintenance.
Controlling termination
Troubleshooting launches
The group's activity history (describe-scaling-activities) records the reason for every failed launch. The following table lists common messages.
| Message or symptom | Cause | Fix |
|---|---|---|
| Launch template ... AMI does not exist | AMI deleted, not shared or in another Region | Update the template version |
| You are not authorized to use launch template / iam:PassRole | Missing permissions for the service-linked role or the instance profile role | Grant iam:PassRole or fix the template |
| InsufficientInstanceCapacity | No capacity for the type in an AZ | Add instance types or AZs |
| VcpuLimitExceeded | Account quota | Request a quota increase |
| Client.InvalidKMSKey.InvalidState / KMS key access | Encrypted volumes and the service-linked role lacks key access | Grant the AWSServiceRoleForAutoScaling role use of the key |
| Desired capacity never reached | Maximum too low, subnet IPs exhausted, or suspended Launch process | Check limits, subnets and suspended processes |
Rolling out a patched AMI
A new hardened AMI is published monthly. The team creates a new launch template version and starts an instance refresh with minimum healthy 90%, maximum healthy 110%, a checkpoint at 25% with a 10-minute wait, skip matching enabled and auto rollback tied to the group's 5XX and latency alarms. In the first batch the 5XX alarm fires because the AMI is missing a library. The refresh rolls back automatically to the previous template version, and no more than 10% of capacity was ever affected.
aws autoscaling start-instance-refresh --auto-scaling-group-name web-asg \
--desired-configuration '{"LaunchTemplate":{"LaunchTemplateName":"web-lt","Version":"7"}}' \
--preferences '{"MinHealthyPercentage":90,"MaxHealthyPercentage":110,"SkipMatching":true,
"CheckpointPercentages":[25,100],"CheckpointDelay":600,"AutoRollback":true,
"AlarmSpecification":{"Alarms":["web-5xx","web-latency"]}}'Does scale-in protection prevent replacement of an unhealthy instance?
Show answer
No. It only stops scale-in terminations.
Exam Tips
Remember for the exam
- Instance refresh rolls out new templates with min/max healthy percentages, checkpoints and auto rollback.
- The default termination policy balances AZs, then removes the oldest launch template.
- Scale-in protection stops scale-in terminations, not health replacements.
- Suspend processes such as ReplaceUnhealthy or AZRebalance during maintenance.
- Read the activity history for the reason a launch failed.