A developer is deploying updates to an AWS CloudFormation stack. The update fails due to a configuration error, initiating an automatic rollback. However, the rollback fails because a security group managed by the stack was manually attached to an EC2 instance outside of CloudFormation, placing the stack in the UPDATE_ROLLBACK_FAILED state. The developer needs to successfully complete the rollback and return the stack to a stable state. Which action should the developer take to resolve this issue?
- ARun the drift detection tool on the stack, select the drifted security group, and choose the 'Import drifted resource state' option to force the template to sync with the manual changes.
- BModify the CloudFormation template to delete the security group definition, and run a new stack update command with the '--force-update' flag to overwrite the active rollback status.
- Execute the 'Continue update rollback' operation, specifying the blocked security group as a resource to skip, and then manually remove the out-of-band association after the rollback completes.Cevap
- DCreate an Amazon EC2 launch template containing the security group, store the launch template ID in AWS Systems Manager Parameter Store as a parameter of type String, and reference it to force-complete the rollback.
Cevap
Execute the 'Continue update rollback' operation, specifying the blocked security group as a resource to skip, and then manually remove the out-of-band association after the rollback completes.
When a resource deletion blocks a stack rollback, the correct procedure is to use the 'Continue update rollback' operation. This action allows the developer to skip the specific resource that is failing to roll back. CloudFormation will mark that resource's state as skipped and proceed to complete the rollback for the rest of the stack, bringing it back to a stable UPDATE_ROLLBACK_COMPLETE status. Afterward, the developer must manually clean up the skipped resource.
Adım Adım Çözüm
Anahtar Kavram
Resolving UPDATE_ROLLBACK_FAILED states by skipping blocked resources during the Continue Update Rollback operation.