Question

Difficulty: HardTroubleshooting CloudFormation and CI/CD Deployments

A developer is updating an AWS CloudFormation stack that manages a production application. The update fails during the creation of a new database instance due to a parameter conflict. CloudFormation automatically initiates a rollback, but the rollback fails because an Amazon S3 bucket, which was manually modified out-of-band, now has a bucket policy that denies the CloudFormation service role the permissions required to delete it. The stack is now in the `UPDATE_ROLLBACK_FAILED` state. The developer updates the S3 bucket policy to allow the CloudFormation service role to delete the bucket.

Which action must the developer perform next to return the stack to a stable state so that future updates can be applied?

  1. A
    Delete the CloudFormation stack to remove the failed state, and then recreate the stack using the corrected template.
  2. Execute the `aws cloudformation continue-update-rollback` command to resume the rollback and return the stack to a stable state.Answer
  3. C
    Execute the `aws cloudformation update-stack` command with the corrected template to directly overwrite the failed rollback state.
  4. D
    Modify the trust policy of the CloudFormation service role to explicitly grant it permissions to delete the S3 bucket.

Answer

Execute the `aws cloudformation continue-update-rollback` command to resume the rollback and return the stack to a stable state.
The correct action is to resume the rollback by executing the `continue-update-rollback` command. Since the permissions issue blocking the deletion of the S3 bucket has been resolved, CloudFormation will successfully delete the bucket and return the stack to the `UPDATE_ROLLBACK_COMPLETE` state, which allows subsequent updates.

Step-by-Step Solution

1
Analyze the stack state.
The stack is in the `UPDATE_ROLLBACK_FAILED` state, which prevents direct stack updates.
You must understand the current lifecycle state of the stack to determine the correct troubleshooting command.
2
Identify the cause of the rollback failure and verify its resolution.
The S3 bucket deletion failure due to bucket policy restrictions has been resolved by modifying the bucket policy.
Resuming the rollback will fail again if the underlying resource blocking the rollback is not fixed first.
3
Trigger the resumption of the rollback process.
Executing the `continue-update-rollback` command resumes the rollback, transitioning the stack to `UPDATE_ROLLBACK_COMPLETE`.
This returns the stack to a stable configuration, enabling future update operations.

Key Concept

Handling CloudFormation stack update rollback failures using the ContinueUpdateRollback action.
Estimated Time:2m 0s
Rate this question