A developer is attempting to update an AWS CloudFormation stack that manages a microservices application. During a previous update attempt, a custom resource failed to stabilize, triggering a rollback. During the rollback, the stack became stuck in the `UPDATE_ROLLBACK_FAILED` state because an IAM role resource defined in the template had been manually deleted from the AWS account. The developer has created a new IAM role and needs to update the stack to use this new role.
How should the developer resolve this issue and successfully apply the update to the stack?
- Initiate the ContinueUpdateRollback operation and specify the deleted IAM role resource to be skipped. After the stack status transitions to UPDATE_ROLLBACK_COMPLETE, update the stack using the new template that references the new IAM role.Answer
- BSubmit a new stack update with the corrected template immediately using the --force-update flag in the AWS CLI to bypass the current rollback state.
- CRun drift detection to automatically identify the missing IAM role, select the option to synchronize the stack resources with the physical resources, and then execute a standard stack update.
- DStore the new IAM role's ARN in AWS Systems Manager Parameter Store, configure the template to dynamically reference this parameter, and initiate a stack synchronization.
Answer
Initiate the ContinueUpdateRollback operation and specify the deleted IAM role resource to be skipped. After the stack status transitions to UPDATE_ROLLBACK_COMPLETE, update the stack using the new template that references the new IAM role.
The correct option outlines the required operational procedure for recovering a stack from the UPDATE_ROLLBACK_FAILED state when a resource (the IAM role) has been deleted out-of-band. The developer must use the ContinueUpdateRollback operation and opt to skip the deleted resource. This allows CloudFormation to bypass the missing resource and complete the rollback sequence, shifting the stack status to UPDATE_ROLLBACK_COMPLETE. From there, a regular stack update can be initiated using the corrected template that points to the new IAM role.
Step-by-Step Solution
Key Concept
CloudFormation Rollback Troubleshooting and Recovery