updateTerminationProtection method

Future<UpdateTerminationProtectionOutput> updateTerminationProtection({
  1. required bool enableTerminationProtection,
  2. required String stackName,
})

Updates termination protection for the specified stack. If a user attempts to delete a stack with termination protection enabled, the operation fails and the stack remains unchanged. For more information, see Protect a CloudFormation stack from being deleted in the CloudFormation User Guide.

For nested stacks, termination protection is set on the root stack and can't be changed directly on the nested stack.

Parameter enableTerminationProtection : Whether to enable termination protection on the specified stack.

Parameter stackName : The name or unique ID of the stack for which you want to set termination protection.

Implementation

Future<UpdateTerminationProtectionOutput> updateTerminationProtection({
  required bool enableTerminationProtection,
  required String stackName,
}) async {
  final $request = <String, String>{
    'EnableTerminationProtection': enableTerminationProtection.toString(),
    'StackName': stackName,
  };
  final $result = await _protocol.send(
    $request,
    action: 'UpdateTerminationProtection',
    version: '2010-05-15',
    method: 'POST',
    requestUri: '/',
    exceptionFnMap: _exceptionFns,
    resultWrapper: 'UpdateTerminationProtectionResult',
  );
  return UpdateTerminationProtectionOutput.fromXml($result);
}