Delete a scaling policy for an Auto Scaling group - Amazon EC2 Auto Scaling
Services or capabilities described in Amazon Web Services documentation might vary by Region. To see the differences applicable to the China Regions, see Getting Started with Amazon Web Services in China (PDF).

Delete a scaling policy for an Auto Scaling group

After you no longer need a scaling policy, you can delete it. Depending on the type of scaling policy, you might also need to delete the CloudWatch alarms. Deleting a target tracking scaling policy also deletes any associated CloudWatch alarms. Deleting a step scaling policy or a simple scaling policy deletes the underlying alarm action, but it does not delete the CloudWatch alarm, even if it no longer has an associated action.

To delete a scaling policy (console)
  1. Open the Amazon EC2 console at https://console.amazonaws.cn/ec2/, and choose Auto Scaling Groups from the navigation pane.

  2. Select the check box next to the Auto Scaling group.

    A split pane opens up in the bottom of the page.

  3. On the Automatic scaling tab, under Dynamic scaling policies, select the check box in the top right corner of the desired scaling policy.

  4. Scroll to the top of the Dynamic scaling policies section, and choose Actions, Delete.

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

  6. (Optional) If you deleted a step scaling policy or a simple scaling policy, do the following to delete the CloudWatch alarm that was associated with the policy. You can skip these substeps to keep the alarm for future use.

    1. Open the CloudWatch console at https://console.amazonaws.cn/cloudwatch/.

    2. On the navigation pane, choose Alarms.

    3. Choose the alarm (for example, Step-Scaling-AlarmHigh-AddCapacity) and choose Action, Delete.

    4. When prompted for confirmation, choose Delete.

To get the scaling policies for an Auto Scaling group (Amazon CLI)

Before you delete a scaling policy, use the following describe-policies command to see what scaling policies were created for the Auto Scaling group. You can use the output when deleting the policy and the CloudWatch alarms.

aws autoscaling describe-policies --auto-scaling-group-name my-asg

You can filter the results by the type of scaling policy using the --query parameter. This syntax for query works on Linux or macOS. On Windows, change the single quotes to double quotes.

aws autoscaling describe-policies --auto-scaling-group-name my-asg --query 'ScalingPolicies[?PolicyType==`TargetTrackingScaling`]'

The following is example output.

[ { "AutoScalingGroupName": "my-asg", "PolicyName": "cpu50-target-tracking-scaling-policy", "PolicyARN": "PolicyARN", "PolicyType": "TargetTrackingScaling", "StepAdjustments": [], "Alarms": [ { "AlarmARN": "arn:aws-cn:cloudwatch:us-west-2:123456789012:alarm:TargetTracking-my-asg-AlarmHigh-fc0e4183-23ac-497e-9992-691c9980c38e", "AlarmName": "TargetTracking-my-asg-AlarmHigh-fc0e4183-23ac-497e-9992-691c9980c38e" }, { "AlarmARN": "arn:aws-cn:cloudwatch:us-west-2:123456789012:alarm:TargetTracking-my-asg-AlarmLow-61a39305-ed0c-47af-bd9e-471a352ee1a2", "AlarmName": "TargetTracking-my-asg-AlarmLow-61a39305-ed0c-47af-bd9e-471a352ee1a2" } ], "TargetTrackingConfiguration": { "PredefinedMetricSpecification": { "PredefinedMetricType": "ASGAverageCPUUtilization" }, "TargetValue": 50.0, "DisableScaleIn": false }, "Enabled": true } ]
To delete your scaling policy (Amazon CLI)

Use the following delete-policy command.

aws autoscaling delete-policy --auto-scaling-group-name my-asg \ --policy-name cpu50-target-tracking-scaling-policy
To delete your CloudWatch alarm (Amazon CLI)

For step and simple scaling policies, use the delete-alarms command to delete the CloudWatch alarm that was associated with the policy. You can skip this step to keep the alarm for future use. 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