Amazon EC2 Auto Scaling
User Guide

The AWS Documentation website is getting a new look!
Try it now and let us know what you think. Switch to the new look >>

You can return to the original look by selecting English in the language selector above.

Deleting Your Auto Scaling Infrastructure

To completely delete your scaling infrastructure, complete the following tasks.

Delete Your Auto Scaling Group

When you delete an Auto Scaling group, its desired, minimum, and maximum values are set to 0. As a result, the instances are terminated. Deleting an instance also deletes any associated logs or data, and any volumes on the instance. If do not want to terminate one or more instances, you can detach them before you delete the Auto Scaling group.

To delete your Auto Scaling group (console)

  1. Open the Amazon EC2 console at https://console.aws.amazon.com/ec2/.

  2. On the navigation pane, under Auto Scaling, choose Auto Scaling Groups.

  3. On the Auto Scaling Groups page, choose your Auto Scaling group and choose Actions, Delete.

  4. When prompted for confirmation, choose Yes, Delete.

To delete your Auto Scaling group (AWS CLI)

Use the following delete-auto-scaling-group command to delete the Auto Scaling group.

aws autoscaling delete-auto-scaling-group --auto-scaling-group-name my-asg

(Optional) Delete the Launch Configuration

You can skip this step to keep the launch configuration for future use.

To delete the launch configuration (console)

  1. Open the Amazon EC2 console at https://console.aws.amazon.com/ec2/.

  2. On the navigation pane, under Auto Scaling, choose Launch Configurations.

  3. On the Launch Configurations page, choose your launch configuration and choose Actions, Delete launch configuration.

  4. When prompted for confirmation, choose Yes, Delete.

To delete the launch configuration (AWS CLI)

Use the following delete-launch-configuration command.

aws autoscaling delete-launch-configuration --launch-configuration-name my-launch-config

(Optional) Delete the Launch Template

You can delete your launch template or just one version of your launch template. When you delete a launch template, all its versions are deleted.

You can skip this step to keep the launch template for future use.

To delete your launch template (console)

  1. Open the Amazon EC2 console at https://console.aws.amazon.com/ec2/.

  2. On the navigation pane, choose Launch Templates.

  3. Select your launch template and then do one of the following:

    • Choose Actions, Delete template. When prompted for confirmation, choose Delete launch template.

    • Choose Actions, Delete template version. Select the version to delete and choose Delete launch template version.

To delete the launch template (AWS CLI)

Use the following delete-launch-template command to delete your template and all its versions.

aws ec2 delete-launch-template --launch-template-id lt-068f72b72934aff71

Alternatively, you can use the delete-launch-template-versions command to delete a specific version of a launch template.

aws ec2 delete-launch-template-versions --launch-template-id lt-068f72b72934aff71 --versions 1

(Optional) Delete the Load Balancer

Skip this step if your Auto Scaling group is not associated with an Elastic Load Balancing load balancer, or if you want to keep the load balancer for future use.

To delete your load balancer (console)

  1. Open the Amazon EC2 console at https://console.aws.amazon.com/ec2/.

  2. On the navigation pane, choose Load Balancers.

  3. Choose the load balancer and choose Actions, Delete.

  4. When prompted for confirmation, choose Yes, Delete.

To delete your target group (console)

  1. On the navigation pane, choose Target Groups.

  2. Choose the target group and choose Actions, Delete.

  3. When prompted for confirmation, choose Yes.

To delete the load balancer associated with the Auto Scaling group (AWS CLI)

For Application Load Balancers and Network Load Balancers, use the following delete-load-balancer and delete-target-group commands.

aws elbv2 delete-load-balancer --load-balancer-arn my-load-balancer-arn aws elbv2 delete-target-group --target-group-arn my-target-group-arn

For Classic Load Balancers, use the following delete-load-balancer command.

aws elb delete-load-balancer --load-balancer-name my-load-balancer

(Optional) Delete CloudWatch Alarms

To delete any CloudWatch alarms associated with your Auto Scaling group, complete the following steps.

You can skip this step if your Auto Scaling group is not associated with any CloudWatch alarms, or if you want to keep the alarms for future use.

Note

Deleting an Auto Scaling group automatically deletes the CloudWatch alarms that Amazon EC2 Auto Scaling manages for a target tracking scaling policy.

To delete the CloudWatch alarms (console)

  1. Open the CloudWatch console at https://console.aws.amazon.com/cloudwatch/.

  2. On the navigation pane, choose Alarms.

  3. Choose the alarms and choose Action, Delete.

  4. When prompted for confirmation, choose Delete.

To delete the CloudWatch alarms (AWS CLI)

Use the delete-alarms command. You can delete one or more alarms at a time. For example, use the following command to delete the Step-Scaling-AlarmHigh-AddCapacity and Step-Scaling-AlarmLow-RemoveCapacity alarms.

aws cloudwatch delete-alarms --alarm-name Step-Scaling-AlarmHigh-AddCapacity Step-Scaling-AlarmLow-RemoveCapacity