CloudConsole

aws autoscaling update-auto-scaling-group

Updated 16 November 2026 · How we write and check guides

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.

Terminal running aws autoscaling update-auto-scaling-group…
A worked example from this page. Copy commands from the text below, not from the image.

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 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

SettingWatch out for
--health-check-type ELBToo short a grace period makes slow-booting instances get killed in a loop
--vpc-zone-identifierReplaces the whole subnet list; removing a subnet can trigger rebalancing that terminates instances there
--max-instance-lifetimeInstances older than this are replaced automatically (minimum one day)
--termination-policiesDecide which instances go first on scale-in, e.g. OldestLaunchTemplate
--new-instances-protected-from-scale-inEvery 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 app → · Download on the App Store

Sources