Operational Excellence and Automation

A service-managed CloudFormation StackSet with automatic deployment targets the Workloads OU and deploys a logging baseline to each account in it. When an account moves out of that OU, the baseline stack must remain in the account instead of being deleted. Which setting meets this requirement?

Show the answer

Correct answerA. Set the automatic deployment's account removal behavior to retain stacks.

AWhy this is right: With retain stacks, CloudFormation removes the stack instance from the StackSet but leaves the stack and its resources in the account.

BWhy not this: The resources survive, but the stack itself is still deleted, leaving unmanaged resources rather than a stack.

CWhy not this: Self-managed permissions do not support automatic deployment to OUs at all.

DWhy not this: Failure tolerance limits how many account failures stop an operation; it does not keep stacks from being deleted.

Automatic deployment in a service-managed StackSet adds stack instances to accounts that join a target OU and, by default, deletes them from accounts that leave it. Setting the account removal behavior to retain stacks removes the stack instance from the StackSet but keeps the stack and its resources in the account. DeletionPolicy: Retain keeps resources but not the stack.