Description
Ensure that AWS CloudFormation stacks supporting production resources have Termination protection enabled, so that the stack (and the resources it manages) cannot be accidentally deleted via the DeleteStack action without first explicitly disabling this protection.
Rationale
Deleting a CloudFormation stack deletes every resource it manages (unless a resource's DeletionPolicy specifies otherwise), so an accidental stack deletion, whether from a console misclick, a scripting error, or a compromised credential, can result in significant, immediate loss of infrastructure and, potentially, data. Enabling Termination protection requires an explicit, deliberate step to disable protection before the stack can be deleted, guarding against this class of accident.
Impact
Prevents accidental deletion of a stack and all the resources it manages
Requires an explicit, deliberate action to disable protection before legitimate stack deletion
Adds an extra step to legitimate decommissioning workflows for the stack
Default Value
Termination protection is disabled by default on newly created CloudFormation stacks.
Pre-Requisites
IAM permissions to update stack settings (cloudformation:UpdateTerminationProtection)
Test Plan
Sign in to the AWS Management Console at https://console.aws.amazon.com.
Navigate to AWS CloudFormation > Stacks.
Select the stack to review.
Open the Stack info tab.
Verify that Termination protection shows as Activated.
If Termination protection is Deactivated for a production stack, follow the implementation steps.
Implementation Steps
Sign in to the AWS Management Console at https://console.aws.amazon.com.
Navigate to AWS CloudFormation > Stacks and select the stack to update.
Select Stack actions, then Edit termination protection.
Select Activate.
Confirm the change.
Verify the Stack info tab now shows Termination protection as Activated.
Backout Plan
Sign in to the AWS Management Console at https://console.aws.amazon.com.
Navigate to AWS CloudFormation > Stacks and select the affected stack.
Select Stack actions, then Edit termination protection.
Select Deactivate.
Confirm the change.
Reference