A developer is updating an AWS CloudFormation stack that manages a web application's network infrastructure. The update fails, and the stack begins to roll back. However, the rollback process fails and the stack is left in the UPDATE_ROLLBACK_FAILED state because one of the subnets was previously deleted manually via the AWS Console. How should the developer resolve this issue to return the stack to a stable state?
- ARun drift detection on the stack, select the deleted subnet from the drift results, and select the console option to import the drift to automatically recreate the resource.
- BPerform a new stack update with the updated template using the --ignore-rollback-errors CLI flag to force the stack back to UPDATE_COMPLETE.
- Use the ContinueUpdateRollback operation and choose to skip the deleted subnet resource during the rollback process, then manually clean up any remaining resources if necessary.Answer
- DStore the subnet configuration as a SecureString parameter in Systems Manager Parameter Store and trigger a stack update using dynamic references.
Answer
Use the ContinueUpdateRollback operation and choose to skip the deleted subnet resource during the rollback process, then manually clean up any remaining resources if necessary.
The correct approach is to run the ContinueUpdateRollback operation and specify the logical IDs of the resources to skip (in this case, the deleted subnet). CloudFormation will set the state of these resources to UPDATE_ROLLBACK_COMPLETE and continue rolling back the remaining resources in the stack. Once the stack reaches a stable state, the developer can update the template or manually recreate resources to align them.
Step-by-Step Solution
Key Concept
Handling CloudFormation stack update rollback failures caused by manual out-of-band resource deletion.
Estimated Time:1m 30s