Soru

Zorluk: ZorAWS CloudFormation

A developer manages a production application stack deployed via AWS CloudFormation. The stack consists of an Amazon RDS DB instance and an Auto Scaling group of Amazon EC2 instances. During a recent deployment, a stack update failed while attempting to modify the DB instance parameters, and the subsequent automatic rollback also failed, leaving the stack in the UPDATE_ROLLBACK_FAILED state. The developer needs to update the launch template of the Auto Scaling group to apply a critical security patch immediately without deleting the existing stack or losing DB instance data. How can the developer successfully apply the launch template update to the stack?

  1. Run the `continue-update-rollback` command and specify the RDS DB instance in the resources to skip parameter. Once the stack status transitions to `UPDATE_ROLLBACK_COMPLETE`, perform the stack update with the modified Auto Scaling group configuration.Cevap
  2. B
    Initiate a new stack update using the `update-stack` command with the `--force` flag to bypass the failed rollback state and overwrite the Auto Scaling group configurations.
  3. C
    Execute the `rollback-stack` command to manually force the stack to return to the last known stable state of `CREATE_COMPLETE`, and then run the update command for the Auto Scaling group.
  4. D
    Perform drift detection on the stack to identify the mismatched RDS configuration, then execute the `resolve-drift` command to automatically align the stack state and reset the status to `UPDATE_ROLLBACK_COMPLETE`.

Cevap

Run the `continue-update-rollback` command and specify the RDS DB instance in the resources to skip parameter. Once the stack status transitions to `UPDATE_ROLLBACK_COMPLETE`, perform the stack update with the modified Auto Scaling group configuration.
The correct answer is to run the `continue-update-rollback` command and specify the RDS DB instance in the resources to skip parameter. When a CloudFormation stack update fails and the rollback also fails, the stack enters the `UPDATE_ROLLBACK_FAILED` state. To perform further updates, the developer must get the stack into a stable state. By continuing the update rollback and skipping the failing DB instance resource, CloudFormation can successfully roll back the rest of the stack, transitioning it to the `UPDATE_ROLLBACK_COMPLETE` state. Once in this stable state, the developer can initiate the stack update for the Auto Scaling group.

Adım Adım Çözüm

1
Identify the resource causing the rollback failure (the Amazon RDS DB instance) and execute the `continue-update-rollback` command (or use the console equivalent).
The stack bypasses the failed rollback of the DB instance and rolls back the other resources successfully.
This is necessary because a stack in the `UPDATE_ROLLBACK_FAILED` state cannot be updated directly; it must first reach a stable state.
2
Wait for the stack status to transition from `UPDATE_ROLLBACK_FAILED` to `UPDATE_ROLLBACK_COMPLETE`.
The stack enters a stable, updatable state.
CloudFormation only allows stack updates when the stack is in a stable status such as `UPDATE_ROLLBACK_COMPLETE` or `CREATE_COMPLETE`.
3
Perform the stack update using the template containing the modified launch template configuration for the Auto Scaling group.
The Auto Scaling group is updated successfully with the critical security patch.
This applies the required changes to the Auto Scaling group now that the stack is in an updatable state.

Anahtar Kavram

Handling CloudFormation stack updates and failures by using the ContinueUpdateRollback action to skip failing resources and return the stack to a stable state.
Bu soruyu puanla