# aws autoscaling update-auto-scaling-group

AWS CLI commands · Updated 16 November 2026

**Short answer:** aws autoscaling update-auto-scaling-group --auto-scaling-group-name my-asg changes the settings of an existing group: size limits, launch template and version, health check type and grace period, subnets, termination policies and more. Only the options you pass change, and most changes apply to new instances rather than running ones.

## What the command does

It updates the group configuration in place. Size changes take effect immediately (and can launch or terminate instances). A new launch template version is used for future launches only; existing instances keep running the old one until they are replaced, which is what an [instance refresh](https://cloudconsole.dev/cli/autoscaling-start-instance-refresh) is for.

## Syntax

```
aws autoscaling update-auto-scaling-group --auto-scaling-group-name <asg> \
  [--min-size <n>] [--max-size <n>] [--desired-capacity <n>] \
  [--launch-template LaunchTemplateName=<lt>,Version=<v>] \
  [--health-check-type EC2|ELB] [--health-check-grace-period <s>] \
  [--vpc-zone-identifier "subnet-a,subnet-b"] \
  [--max-instance-lifetime <s>] [--default-instance-warmup <s>]
```

## Worked examples

**Raise the size limits** for a busy period:

```
aws autoscaling update-auto-scaling-group --auto-scaling-group-name web-prod \
  --min-size 4 --max-size 20
```

**Always launch the latest launch template version**. Quote `$Latest` so the shell does not expand it:

```
aws autoscaling update-auto-scaling-group --auto-scaling-group-name web-prod \
  --launch-template 'LaunchTemplateName=web-prod,Version=$Latest'
```

**Pin a specific version** instead, which is safer for production rollouts:

```
aws autoscaling update-auto-scaling-group --auto-scaling-group-name web-prod \
  --launch-template LaunchTemplateName=web-prod,Version=17
```

**Use load balancer health checks** so instances failing the target group check are replaced:

```
aws autoscaling update-auto-scaling-group --auto-scaling-group-name web-prod \
  --health-check-type ELB --health-check-grace-period 300
```

**Add a subnet in another Availability Zone:**

```
aws autoscaling update-auto-scaling-group --auto-scaling-group-name web-prod \
  --vpc-zone-identifier "subnet-0a1b2c3d4e5f60001,subnet-0a1b2c3d4e5f60002,subnet-0a1b2c3d4e5f60003"
```

**Confirm the result:**

```
aws autoscaling describe-auto-scaling-groups --auto-scaling-group-names web-prod \
  --query "AutoScalingGroups[0].{min:MinSize,max:MaxSize,desired:DesiredCapacity,lt:LaunchTemplate,hc:HealthCheckType}"
```

## Safe change routine

1. Save the current configuration with `describe-auto-scaling-groups` so you can put it back.
2. Make one change at a time; combining size, template and subnet changes makes it hard to tell what caused a problem.
3. Watch `describe-scaling-activities` for the next few minutes for launches or terminations you did not expect.

## Settings that bite

| Setting | Watch out for |
|---|---|
| `--health-check-type ELB` | Too short a grace period makes slow-booting instances get killed in a loop |
| `--vpc-zone-identifier` | Replaces the whole subnet list; removing a subnet can trigger rebalancing that terminates instances there |
| `--max-instance-lifetime` | Instances older than this are replaced automatically (minimum one day) |
| `--termination-policies` | Decide which instances go first on scale-in, e.g. `OldestLaunchTemplate` |
| `--new-instances-protected-from-scale-in` | Every new instance is protected, so scale-in can stall |

## Gotchas

- **Running instances are not updated.** Changing the launch template or user data does nothing to existing instances until they are replaced.
- **`$Latest` vs `$Default`.** `$Latest` picks up every new version immediately, including untested ones; pinning a number makes rollouts deliberate.
- **Desired outside the new limits is adjusted.** Lowering max below the current desired capacity scales the group in.
- **ECS service auto scaling is not this.** Task counts for ECS services are managed by Application Auto Scaling (`aws application-autoscaling register-scalable-target`), while this command manages the EC2 instances in a capacity provider's group.

## Questions

### How do I update the launch template of an Auto Scaling group?

Pass --launch-template LaunchTemplateName=<name>,Version=<n> (or $Latest). Then start an instance refresh to replace running instances with the new version.

### How do I update ECS service auto scaling from the CLI?

ECS services scale through Application Auto Scaling: change limits with aws application-autoscaling register-scalable-target and policies with put-scaling-policy, using service namespace ecs.

### Does update-auto-scaling-group restart instances?

No. It only changes configuration. Instances are launched or terminated if size limits change, and replaced only by health checks, max lifetime or an instance refresh.

## When this happens away from your desk

Group settings changed in a hurry tend to be forgotten until the next incident. CloudConsole, a phone app for AWS, is built to show Auto Scaling groups and their alarms on a phone.

[About the CloudConsole app](https://cloudconsole.dev/aws-console-app) · [Download on the App Store](https://apps.apple.com/app/cloudconsole-for-aws/id6835419710)

## Sources

- [aws autoscaling update-auto-scaling-group (AWS CLI Command Reference)](https://docs.aws.amazon.com/cli/latest/reference/autoscaling/update-auto-scaling-group.html)
- [Update an Auto Scaling group (EC2 Auto Scaling User Guide)](https://docs.aws.amazon.com/autoscaling/ec2/userguide/update-auto-scaling-group.html)

## Related

- [aws autoscaling set-desired-capacity](https://cloudconsole.dev/cli/autoscaling-set-desired-capacity)
- [aws autoscaling start-instance-refresh](https://cloudconsole.dev/cli/autoscaling-start-instance-refresh)
- [CloudWatch alarm for Auto Scaling GroupInServiceCapacity](https://cloudconsole.dev/alarms/auto-scaling-groupinservicecapacity)
- [How to change an EC2 instance type](https://cloudconsole.dev/how-to/change-ec2-instance-type)
- [aws ecs update-service](https://cloudconsole.dev/cli/ecs-update-service)

---

Source: https://cloudconsole.dev/cli/autoscaling-update-auto-scaling-group

CloudConsole is an independent iPhone and Android app for Amazon Web Services by Cloudconcur Ltd. It is not affiliated with Amazon Web Services.
