A developer attempts to deploy a new stack named `prod-app-backend` using AWS CloudFormation. The initial stack creation fails due to a syntax error in the resource properties, and the stack status transitions to `ROLLBACK_COMPLETE`. After correcting the syntax error in the template, the developer tries to perform a stack update using the corrected template and the same stack name, but the update fails. Which action must the developer take to deploy the stack successfully?
- ARun the `aws cloudformation continue-update-rollback` CLI command to resume the deployment.
- BUpdate the trust policy of the IAM service role to allow CloudFormation to assume the role, then retry the update.
- Delete the stack and recreate it using the updated template.Answer
- DDisable the rollback behavior in the stack settings and retry the stack update.
Answer
Delete the stack and recreate it using the updated template.
When a CloudFormation stack fails its initial creation, it rolls back all resources and transitions to `ROLLBACK_COMPLETE`. A stack in this state cannot be updated because it was never successfully created. To deploy the stack with the same name, the developer must first delete the existing stack and then create a new one using the corrected template.
Step-by-Step Solution
Key Concept
CloudFormation Stack Lifecycle and Rollback States
Estimated Time:1m 30s