AWS · Compute
Amazon EC2 Auto Scaling
Keeps the right number of EC2 instances running: replaces unhealthy ones and adds or removes capacity as load changes.
What it is and what problem it solves
Amazon EC2 Auto Scaling manages Auto Scaling groups: sets of instances created from a launch template, with a minimum, maximum and desired capacity, spread across the subnets (and so Availability Zones) you choose. It replaces instances that fail health checks and changes capacity with scaling policies:
- Target tracking: keep a metric at a target, such as average CPU at 50 percent or requests per target.
- Step and simple scaling: add or remove instances when CloudWatch alarms fire.
- Scheduled scaling: change capacity at known times.
- Predictive scaling: forecast daily and weekly patterns and scale ahead of them.
Groups can mix instance types and On-Demand with Spot capacity.
When to use it
- Any EC2-based service that must survive instance and zone failures.
- Load that varies over the day or week.
- Workers that should scale on queue depth.
- Fleets that should use Spot capacity across many instance types.
When to avoid it
- Workloads that already scale for you: Lambda, Fargate services with ECS service auto scaling, DynamoDB.
- Stateful single servers that cannot be replaced automatically without losing data.
Scaling model and bottlenecks
Target tracking is the usual choice. New instances need time to boot and warm up, so use launch templates with pre-baked AMIs, warm pools or predictive scaling for fast-rising traffic.
Limits and quotas
| Item | Value | Context | Source |
|---|---|---|---|
| Auto Scaling groups per Region | 500 | Source checked |
|
| Scaling policies per Auto Scaling group | 50 Fixed limit |
Source checked |
|
| Lifecycle hooks per Auto Scaling group | 50 Fixed limit |
Source checked |
|
| Default cooldown | 300 seconds | Applies to simple scaling policies; can be changed per group. | Source checked |
Quotas and limits change. Check the linked source before designing around a number.
Cost model
What you pay for
There is no additional charge for EC2 Auto Scaling. You pay for the instances it launches and for CloudWatch alarms and metrics beyond free amounts.
Where it is cost-efficient
Scaling in when load drops, so you pay only for needed capacity, and mixing Spot with On-Demand.
Where costs grow
A minimum capacity set too high, scaling policies that react slowly to drops, or a maximum with no ceiling on cost.
Cost controls and common surprises
Set sensible minimums and maximums, scale in on target tracking, and use mixed instance policies with Spot.
Prices differ by Region and change over time; see the pricing page linked under Sources.
Security
Controls the service provides
Instances launch from launch templates that set the AMI, role, security groups and IMDS settings consistently.
What you configure
Keep launch templates hardened (IMDSv2, encrypted volumes, least-privilege roles), use lifecycle hooks for bootstrapping and log collection before termination.
Logging and monitoring
Scaling activities in the console and CloudTrail; CloudWatch metrics for group size.
Related security services
Elastic Load Balancing, CloudWatch, Systems Manager, IAM.
Shared responsibility
AWS replaces and scales instances as configured. You secure the instances it launches.
Availability, backup and failure behavior
Spread a group across at least two Availability Zones; it rebalances instances across zones and replaces unhealthy instances. Use ELB health checks so instances failing at the application level are replaced too.
Common service combinations
Elastic Load Balancing target groups; CloudWatch alarms and metrics; SQS queue depth for worker fleets; launch templates with Systems Manager parameters for AMI IDs.
Business application examples
- A web fleet that keeps average CPU near 50 percent and doubles on Black Friday.
- Image-processing workers scaling on SQS backlog per instance.
Exam cues and common confusions
- Replace unhealthy instances automatically, across zones: Auto Scaling group with ELB health checks.
- Keep a metric at a value: target tracking. Known daily peaks: scheduled or predictive scaling.
- Run scripts before an instance is terminated: lifecycle hooks.
- Scale workers on a queue: a backlog-per-instance custom metric.
Related
Courses and lessons
- EC2 Auto Scaling · AWS Solutions Architect – Associate (SAA-C03) · Members
- High availability, fault tolerance and removing single points of failure · AWS Solutions Architect – Associate (SAA-C03) · Members
Services, comparisons and patterns
- Amazon EC2 · Service
- Elastic Load Balancing (ELB) · Service
- Amazon CloudWatch · Service
- AWS Auto Scaling · Service
- Amazon SQS · Service
- High availability · Concept
- EC2 purchase options: On-Demand vs Savings Plans vs Reserved vs Spot vs Dedicated · Comparison
Sources
Independent study material, not affiliated with or endorsed by Amazon Web Services. AWS and service names are trademarks of Amazon.com, Inc. or its affiliates.