# AWS Auto Scaling

> Amazon EC2 Auto Scaling keeps the right number of EC2 instances running, replaces unhealthy ones and adds or removes capacity as the load changes.

- Source: https://www.itwonderlab.com/aws-auto-scaling/
- Published: 2026-10-05
- Updated: 2026-10-05
- Author: Javier Ruiz Jiménez (https://www.javierruizjimenez.com/)
- Site: IT Wonder Lab (https://www.itwonderlab.com/)

---

**Amazon EC2 Auto Scaling** launches and terminates [EC2](https://www.itwonderlab.com/aws-ec2/) instances automatically. A group of instances is managed as a unit: AWS keeps it between a minimum and a maximum size, spreads the instances across Availability Zones and replaces the ones that fail their health checks.

### Key concepts

- **Launch template**: the blueprint of the instances: [AMI](https://www.itwonderlab.com/aws-ami/), instance type, key pair, [security groups](https://www.itwonderlab.com/aws-security-groups/), user data ([Cloud-init](https://www.itwonderlab.com/cloud-init/)), tags and [IAM](https://www.itwonderlab.com/aws-iam/) instance profile.
- **Auto Scaling group (ASG)**: the minimum, maximum and desired number of instances and the [subnets](https://www.itwonderlab.com/aws-subnets/) where they run.
- **Scaling policies**: *target tracking* (keep a metric, such as the average CPU, near a value), *step* and *simple* scaling, *scheduled* actions and *predictive* scaling.
- **Health checks**: EC2 status checks, and optionally the health checks of an [Elastic Load Balancer](https://www.itwonderlab.com/aws-elastic-load-balancing/).
- **Instance refresh**: replaces the instances gradually when the launch template changes.
- **Warm pools** and **lifecycle hooks** speed up and customize the start and the termination of instances.

### Pricing

There is no charge for Auto Scaling itself. You pay for the resources that it launches (instances, volumes, data transfer) and for optional detailed [CloudWatch](https://www.itwonderlab.com/aws-cloudwatch/) monitoring.

### With Terraform

The resources are `aws_launch_template`, `aws_autoscaling_group`, `aws_autoscaling_policy` and `aws_autoscaling_schedule`. Add `ignore_changes = [desired_capacity]` to the group so that Terraform does not undo the changes made by the scaling policies.

See tutorials:

-   [AWS with Terraform: The Essential Guide (15/21) – AWS Auto Scaling](https://www.itwonderlab.com/aws-terraform-tutorial-aws-auto-scaling/)

See also: [AWS EKS](https://www.itwonderlab.com/aws-eks/) node groups and [AWS ECS](https://www.itwonderlab.com/aws-ecs/) capacity use Auto Scaling groups.
