AWS SDK Version 3 for .NET
API Reference

AWS services or capabilities described in AWS Documentation may vary by region/location. Click Getting Started with Amazon AWS to see specific differences applicable to the China (Beijing) Region.

Deletes the specified Application Auto Scaling scaling policy.

Deleting a policy deletes the underlying alarm action, but does not delete the CloudWatch alarm associated with the scaling policy, even if it no longer has an associated action.

To create a scaling policy or update an existing one, see PutScalingPolicy.

Note:

For PCL this operation is only available in asynchronous form. Please refer to DeleteScalingPolicyAsync.

Namespace: Amazon.ApplicationAutoScaling
Assembly: AWSSDK.ApplicationAutoScaling.dll
Version: 3.x.y.z

Syntax

C#
public virtual DeleteScalingPolicyResponse DeleteScalingPolicy(
         DeleteScalingPolicyRequest request
)
Parameters
request
Type: Amazon.ApplicationAutoScaling.Model.DeleteScalingPolicyRequest

Container for the necessary parameters to execute the DeleteScalingPolicy service method.

Return Value
The response from the DeleteScalingPolicy service method, as returned by ApplicationAutoScaling.

Exceptions

ExceptionCondition
ConcurrentUpdateException Concurrent updates caused an exception, for example, if you request an update to an Application Auto Scaling resource that already has a pending update.
InternalServiceException The service encountered an internal error.
ObjectNotFoundException The specified object could not be found. For any Put or Register API operation, which depends on the existence of a scalable target, this exception is thrown if the scalable target with the specified service namespace, resource ID, and scalable dimension does not exist. For any Delete or Deregister API operation, this exception is thrown if the resource that is to be deleted or deregistered cannot be found.
ValidationException An exception was thrown for a validation issue. Review the available parameters for the API request.

Examples

This example deletes a scaling policy for the Amazon ECS service called web-app, which is running in the default cluster.

To delete a scaling policy


var response = client.DeleteScalingPolicy(new DeleteScalingPolicyRequest 
{
    PolicyName = "web-app-cpu-lt-25",
    ResourceId = "service/default/web-app",
    ScalableDimension = "ecs:service:DesiredCount",
    ServiceNamespace = "ecs"
});


            

Version Information

.NET Framework:
Supported in: 4.5, 4.0, 3.5

Portable Class Library:
Supported in: Windows Store Apps
Supported in: Windows Phone 8.1
Supported in: Xamarin Android
Supported in: Xamarin iOS (Unified)
Supported in: Xamarin.Forms

See Also