Question

Difficulty: MediumAWS CloudFormation

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?

  1. A
    Run 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.
  2. B
    Perform a new stack update with the updated template using the --ignore-rollback-errors CLI flag to force the stack back to UPDATE_COMPLETE.
  3. 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
  4. D
    Store 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

1
Identify the cause of the rollback failure
Confirm that the stack is in the UPDATE_ROLLBACK_FAILED state due to an out-of-band deletion of the subnet resource.
Before taking corrective action, the developer must verify which resource is blocking the rollback process.
2
Initiate the ContinueUpdateRollback operation
Start the rollback continuation process using the AWS Console, AWS CLI, or CloudFormation API.
This operation is required to force CloudFormation to attempt to complete the rollback again.
3
Specify resources to skip during rollback
Select the deleted subnet resource to be skipped.
Skipping the deleted resource allows CloudFormation to set its status to rolled back without attempting to modify the non-existent resource, bringing the stack to the stable UPDATE_ROLLBACK_COMPLETE state.

Key Concept

Handling CloudFormation stack update rollback failures caused by manual out-of-band resource deletion.
Estimated Time:1m 30s
Rate this question