cancelUpdateStack method

Future<void> cancelUpdateStack({
  1. required String stackName,
  2. String? clientRequestToken,
})

Cancels an update on the specified stack. If the call completes successfully, the stack rolls back the update and reverts to the previous stack configuration.

May throw TokenAlreadyExistsException.

Parameter stackName :

The IAM policy below can be added to IAM policies when you want to limit resource-level permissions and avoid returning a response when no parameter is sent in the request:

{ "Version": "2012-10-17", "Statement": [{ "Effect": "Deny", "Action": "cloudformation:DescribeStacks", "NotResource": "arn:aws:cloudformation:::stack//" }] } The name or the unique stack ID that's associated with the stack.

Parameter clientRequestToken : A unique identifier for this CancelUpdateStack request. Specify this token if you plan to retry requests so that CloudFormation knows that you're not attempting to cancel an update on a stack with the same name. You might retry CancelUpdateStack requests to ensure that CloudFormation successfully received them.

Implementation

Future<void> cancelUpdateStack({
  required String stackName,
  String? clientRequestToken,
}) async {
  final $request = <String, String>{
    'StackName': stackName,
    if (clientRequestToken != null) 'ClientRequestToken': clientRequestToken,
  };
  await _protocol.send(
    $request,
    action: 'CancelUpdateStack',
    version: '2010-05-15',
    method: 'POST',
    requestUri: '/',
    exceptionFnMap: _exceptionFns,
  );
}