- Navigation GuideYou are on a Command (operation) page with structural examples. Use the navigation breadcrumb if you would like to return to the Client landing page.
DeletePolicyCommand
Deletes the specified scaling policy.
Deleting either a step scaling policy or a simple scaling policy deletes the underlying alarm action, but does not delete the alarm, even if it no longer has an associated action.
For more information, see Delete a scaling policy in the Amazon EC2 Auto Scaling User Guide.
Example Syntax
Use a bare-bones client and the command you need to make an API call.
import { AutoScalingClient, DeletePolicyCommand } from "@aws-sdk/client-auto-scaling"; // ES Modules import
// const { AutoScalingClient, DeletePolicyCommand } = require("@aws-sdk/client-auto-scaling"); // CommonJS import
const client = new AutoScalingClient(config);
const input = { // DeletePolicyType
AutoScalingGroupName: "STRING_VALUE",
PolicyName: "STRING_VALUE", // required
};
const command = new DeletePolicyCommand(input);
const response = await client.send(command);
// {};
Example Usage
Loading code editor
DeletePolicyCommand Input
See DeletePolicyCommandInput for more details
Parameter | Type | Description |
---|
Parameter | Type | Description |
---|---|---|
PolicyName Required | string | undefined | The name or Amazon Resource Name (ARN) of the policy. |
AutoScalingGroupName | string | undefined | The name of the Auto Scaling group. |
DeletePolicyCommand Output
See DeletePolicyCommandOutput for details
Parameter | Type | Description |
---|
Parameter | Type | Description |
---|---|---|
$metadata Required | ResponseMetadata | Metadata pertaining to this request. |
Throws
Name | Fault | Details |
---|
Name | Fault | Details |
---|---|---|
ResourceContentionFault | server | You already have a pending update to an Amazon EC2 Auto Scaling resource (for example, an Auto Scaling group, instance, or load balancer). |
ServiceLinkedRoleFailure | server | The service-linked role is not yet ready for use. |
AutoScalingServiceException | Base exception class for all service exceptions from AutoScaling service. |