deletePolicy method
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.
May throw ResourceContentionFault.
May throw ServiceLinkedRoleFailure.
Parameter policyName :
The name or Amazon Resource Name (ARN) of the policy.
Parameter autoScalingGroupName :
The name of the Auto Scaling group.
Implementation
Future<void> deletePolicy({
required String policyName,
String? autoScalingGroupName,
}) async {
final $request = <String, String>{
'PolicyName': policyName,
if (autoScalingGroupName != null)
'AutoScalingGroupName': autoScalingGroupName,
};
await _protocol.send(
$request,
action: 'DeletePolicy',
version: '2011-01-01',
method: 'POST',
requestUri: '/',
exceptionFnMap: _exceptionFns,
);
}