A SysOps administrator initiates an update on a production AWS CloudFormation stack. The update fails during the modification of a database resource, triggering an automatic rollback. During this process, the stack status transitions to `UPDATE_ROLLBACK_FAILED`. Upon reviewing the stack events, the administrator discovers that CloudFormation cannot delete an old security group because it is still associated with an EC2 instance that was manually launched by a developer outside of CloudFormation. Which action should the SysOps administrator take to resolve the `UPDATE_ROLLBACK_FAILED` state and return the stack to a stable configuration?
- Run the `continue-update-rollback` CLI command with the `--resources-to-skip` parameter to skip the security group, then manually disassociate it from the EC2 instance once the stack is stable.Cevap
- BModify the local CloudFormation template to remove the security group resource, and execute a stack update using the updated template to force the rollback to finish.
- CDelete the entire CloudFormation stack while selecting the option to retain the security group, then redeploy the stack from the previous template.
- DAdd the `iam:PassRole` permission to the CloudFormation execution role's policy to grant CloudFormation the authority to detach the security group from the manually launched EC2 instance.
Cevap
Run the `continue-update-rollback` CLI command with the `--resources-to-skip` parameter to skip the security group, then manually disassociate it from the EC2 instance once the stack is stable.
The correct action is to run the `continue-update-rollback` CLI command with the `--resources-to-skip` parameter specifying the logical ID of the blocked security group. When a resource rollback fails because of an external dependency (such as an active association with a manually created EC2 instance), CloudFormation blocks the rollback. Skipping this resource allows CloudFormation to complete the rollback for the remaining resources and return the stack to a stable `UPDATE_ROLLBACK_COMPLETE` status, after which the administrator can clean up the manual resource dependency.
Adım Adım Çözüm
Anahtar Kavram
Handling stack rollback failures by skipping resources that cannot be deleted or updated due to external dependencies.