Auto Scaling Groups: Elasticity and Self-Healing

An Auto Scaling Group (ASG) is like a thermostat for your servers, automatically adding or removing instances to match demand and replacing any that fail. Use it for web apps with variable traffic or services that need to self-heal from instance failures.
Why it exists
Manually provisioning servers for peak traffic is wasteful, and manually replacing failed servers is slow and error-prone. Auto Scaling Groups were created to automate both elasticity (matching capacity to demand) and fault tolerance (recovering from instance failures).
The mental model
Think of an ASG as a manager for a team of worker instances. You tell the manager, "I always want at least 2 workers, at most 10, and right now I need 3." The manager hires and fires workers (launches/terminates instances) to meet the current need and replaces any worker who gets sick (fails a health check).
How it works
An ASG operates based on three key settings: minimum, maximum, and desired capacity. It starts by launching instances to meet the 'desired' count. It then performs periodic health checks; if an instance is unhealthy, the ASG terminates it and launches a new one to maintain the 'desired' capacity. Scaling policies, triggered by metrics like CPU utilization, can automatically adjust the 'desired' capacity up or down, but never outside the 'min' and 'max' bounds. The ASG can also be configured to distribute instances across multiple Availability Zones for resilience.
When to use it
Use an ASG for stateless web frontends, API endpoints, or any application layer that can scale horizontally. It's ideal for workloads with predictable daily traffic patterns (using scheduled scaling) or unpredictable spikes (using dynamic scaling). It is a foundational component for building fault-tolerant systems.
When not to use it
Avoid ASGs for stateful applications like single-node databases that can't be easily cloned or terminated. If an instance holds unique, persistent data, automatically replacing it can lead to data loss. Also, for applications with very long boot times, scaling out might be too slow to meet sudden demand, though features like warm pools can mitigate this.
One canonical example
A news website configures an ASG with a minimum of 2 instances and a maximum of 20. A scaling policy is set to add instances when average CPU usage exceeds 70%. When a major story breaks, traffic surges, CPU usage climbs, and the ASG automatically launches new instances. As the story's popularity wanes, CPU usage drops, and another policy triggers the ASG to terminate unneeded instances, saving costs.
Interview question
Which of the following best describes the primary function of an Auto Scaling Group (ASG)?
- a.To ensure instances are provisioned across different Availability Zones for high availability.
- b.To manage the deployment and updates of application code across a fleet of servers.
- c.To automatically distribute incoming network traffic across multiple healthy instances.
- d.To dynamically adjust the number of instances based on demand and automatically replace failed instances.Correct
Why? this is the answer
The card explicitly states ASGs automate both 'elasticity (matching capacity to demand)' and 'fault tolerance (recovering from instance failures),' which aligns with dynamically adjusting instance count and replacing failed instances. Option C describes the function of a load balancer, which works in conjunction with an ASG but is not the ASG's primary role.
Just read this? Test yourself on what you have been reading.
Read the original → docs.aws.amazon.com
You just looked this up. Could you explain it out loud?
That is the part interviews actually test. Tezvyn takes questions like this one and gives you what the interviewer is really checking, the answer that lands, and the mistake that ends the conversation, in the four minutes before your next meeting.
The iPhone app is on the way
We are building it. Until it lands, nothing here is held back from you: every interview card, your saved cards, streaks and the job board all work in Safari, plus hundreds of free practice quizzes of thirty questions each. Sign in and it all carries over to the app the day it arrives.
Want it as an icon? Tap Share at the bottom of Safari, then Add to Home Screen. It opens full screen and the cards you have read stay available offline.
We are hiring for this. Open roles that interview on aws — each one lists the topics its interview covers.
See open roles