Question

Difficulty: HardAWS CloudFormation Stack and Drift Management

A SysOps Administrator is managing an infrastructure stack using AWS CloudFormation. The stack contains an Amazon EC2 instance and an Amazon RDS DB instance. During a recent stack update, the update failed, and CloudFormation attempted to roll back the changes. However, the rollback failed because a database administrator had manually deleted the RDS DB instance out-of-band, leaving the stack stuck in the UPDATE_ROLLBACK_FAILED state. The administrator needs to return the stack to a stable, operable state without impacting the running EC2 instance. Which action should the SysOps Administrator take to resolve this issue?

  1. A
    Manually recreate the RDS DB instance with the identical identifier in the RDS console, then run the aws cloudformation update-stack CLI command to force CloudFormation to sync with the new resource.
  2. B
    Delete the CloudFormation stack while selecting the option to retain the EC2 instance, then recreate the stack using the original template to re-establish the RDS DB instance.
  3. Run the aws cloudformation continue-update-rollback CLI command and specify the RDS DB instance logical ID in the --resources-to-skip parameter, then manually recreate or import the database to sync with the template.Answer
  4. D
    Update the CloudFormation stack service role with iam:PassRole permissions, then run the aws cloudformation rollback-stack CLI command to force the rollback to bypass the missing resource.

Answer

Run the aws cloudformation continue-update-rollback CLI command and specify the RDS DB instance logical ID in the --resources-to-skip parameter, then manually recreate or import the database to sync with the template.
The correct action is to run the continue-update-rollback command and specify the RDS DB instance logical ID in the resources to skip parameter. This allows CloudFormation to skip the rollback operations for the deleted resource and transition the stack to the UPDATE_ROLLBACK_COMPLETE state, returning it to a stable, operable state.

Step-by-Step Solution

1
Identify the logical ID of the resource that is causing the rollback to fail from the CloudFormation stack events console.
The resource is identified as the deleted Amazon RDS DB instance.
CloudFormation is failing to roll back because the physical RDS resource no longer exists.
2
Execute the continue-update-rollback command using the AWS CLI or CloudFormation console, passing the RDS DB instance logical ID to the --resources-to-skip parameter.
CloudFormation bypasses attempting to roll back the RDS DB instance and sets the stack status to UPDATE_ROLLBACK_COMPLETE.
Bypassing the failed rollback step allows the rest of the stack to return to a stable, modifiable state.
3
Recreate or import the database instance manually to establish configuration alignment with the template.
The resource is aligned and the stack can now accept new updates.
Since the resource was skipped during rollback, it remains unmanaged or deleted until manual intervention or a template import is performed.

Key Concept

Remediating rollback failures caused by out-of-band resource deletion using ContinueUpdateRollback
Estimated Time:2m 30s
Rate this question