Soru

Zorluk: KolayTroubleshooting CloudFormation and CI/CD Deployments

A developer attempts to create a new AWS CloudFormation stack. The stack creation fails due to a resource configuration error, and the stack status transitions to ROLLBACK_COMPLETE. After correcting the error in the template, the developer attempts to update the stack with the corrected template, but the operation fails. Which of the following actions must the developer take to successfully deploy the resources?

  1. Delete the failed stack and create a new stack using the corrected template.Cevap
  2. B
    Run drift detection on the stack and resolve any out-of-band changes before retrying the update.
  3. C
    Modify the IAM trust policy of the CloudFormation role to allow the stack to transition out of the rollback state.
  4. D
    Add a buildspec.yml file to the root directory containing instructions for the rollback phase.

Cevap

Delete the failed stack and create a new stack using the corrected template.
When the initial creation of a CloudFormation stack fails, the stack rolls back and enters the ROLLBACK_COMPLETE state. A stack in this state cannot be updated or recovered. The only way to deploy the resources with a corrected template is to delete the failed stack and create a new one.

Adım Adım Çözüm

1
Analyze the CloudFormation stack state.
The stack is in the ROLLBACK_COMPLETE state after failing its initial creation.
Understanding the current state of the stack determines whether an update is possible.
2
Determine if a stack update can be performed in this state.
CloudFormation does not allow updates to stacks that failed initial creation and rolled back.
Stacks in the ROLLBACK_COMPLETE status must be deleted before the resources can be created again.
3
Identify the correct resolution step.
Delete the failed stack and create a new one using the corrected template.
This removes the failed stack and allows a clean creation attempt with the fixed template.

Anahtar Kavram

CloudFormation Rollback States and Stack Lifecycle
Tahmini Süre:45s
Bu soruyu puanla