Hi everyone — in this demo we cover how to diagnose and recover from AWS CloudFormation stack creation failures. You’ll learn why CloudFormation rolls back failed stacks by default, how to preserve failed resources for debugging, and the typical recovery options. We start with a minimal S3 bucket template used in the demo. Original template (used earlier, included Tags):Documentation Index
Fetch the complete documentation index at: https://notes.kodekloud.com/llms.txt
Use this file to discover all available pages before exploring further.
- Choose Create stack → With new resources (standard).
- Select Upload a template file and upload the file (for example
simple-s3.yaml). - Give the stack a name such as
DemoStack. - Submit creation and wait while CloudFormation processes the stack.


| Recovery option | When to use it | Notes / example |
|---|---|---|
| Delete and fix | Normal recovery | Remove the failed stack, fix the template (e.g., remove BucketName or supply a unique name), then recreate the stack. |
| Disable rollback at create time | Debugging only | Preserve created resources to inspect why the failure happened. Must clean up resources manually afterwards. |
| Use unique names / generated names | Prevent failures | Avoid fixed global names for S3 buckets — either omit BucketName so CloudFormation generates one, or supply a name that is globally unique. |
S3 bucket names are globally unique across all AWS accounts and regions. If you specify a bucket name that already exists, CloudFormation will fail with “BucketAlreadyExists” or “BucketAlreadyOwnedByYou”. Best practice: omit the
BucketName property to let CloudFormation generate a unique name, or use a sufficiently unique naming scheme.If you disable rollback to inspect failed resources, remember to clean them up manually afterwards. Partially-created resources can incur charges or block future deploys.
- Check the Events pane for the error message (e.g., BucketAlreadyExists).
- Decide whether to delete and retry (fix the template) or recreate with rollback disabled to inspect resources.
- If disabling rollback, plan and perform manual cleanup after debugging.