Amazon EC2 Auto Scaling
User Guide

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 Auto Scaling instances are terminated. Alternatively, you can terminate or detach the instances before you delete the Auto Scaling group.

To delete your Auto Scaling group using the 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, select your Auto Scaling group and choose Actions, Delete.

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

To delete your Auto Scaling group using the 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 using the console

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

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

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

To delete the launch configuration using the AWS CLI

Use the following delete-launch-configuration command:

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

(Optional) Delete the Load Balancer

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

To delete your load balancer

  1. On the navigation pane, under LOAD BALANCING, choose Load Balancers.

  2. Select the load balancer and choose Actions, Delete.

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

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

For Application Load Balancers and Network Load Balancers, use the following delete-load-balancer command:

aws elbv2 delete-load-balancer --load-balancer-arn my-load-balancer-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

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.

To delete the CloudWatch alarms using the console

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

  2. On the navigation pane, choose Alarms.

  3. Select the alarms and choose Delete.

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

To delete the CloudWatch alarms using the AWS CLI

Use the delete-alarms command. For example, use the following command to delete the AddCapacity and RemoveCapacity alarms:

aws cloudwatch delete-alarms --alarm-name AddCapacity RemoveCapacity