Soru

Zorluk: OrtaTroubleshooting CloudFormation and CI/CD Deployments

A developer attempts to deploy a new stack named `prod-app-backend` using AWS CloudFormation. The initial stack creation fails due to a syntax error in the resource properties, and the stack status transitions to `ROLLBACK_COMPLETE`. After correcting the syntax error in the template, the developer tries to perform a stack update using the corrected template and the same stack name, but the update fails. Which action must the developer take to deploy the stack successfully?

  1. A
    Run the `aws cloudformation continue-update-rollback` CLI command to resume the deployment.
  2. B
    Update the trust policy of the IAM service role to allow CloudFormation to assume the role, then retry the update.
  3. Delete the stack and recreate it using the updated template.Cevap
  4. D
    Disable the rollback behavior in the stack settings and retry the stack update.

Cevap

Delete the stack and recreate it using the updated template.
When a CloudFormation stack fails its initial creation, it rolls back all resources and transitions to `ROLLBACK_COMPLETE`. A stack in this state cannot be updated because it was never successfully created. To deploy the stack with the same name, the developer must first delete the existing stack and then create a new one using the corrected template.

Adım Adım Çözüm

1
Identify the current state of the stack.
The stack is in the `ROLLBACK_COMPLETE` state after a failed initial creation attempt.
CloudFormation stacks that fail their initial creation roll back and enter this state. They contain no successfully deployed resources.
2
Determine if an update operation is supported.
Update operations are rejected by CloudFormation for stacks in the `ROLLBACK_COMPLETE` state that resulted from a failed creation.
Since the stack was never successfully created in the first place, there is no active baseline to update.
3
Perform the required cleanup and redeployment.
Delete the failed stack to release the stack name, then run the creation process with the corrected template.
Deleting the stack removes the metadata entry in CloudFormation, allowing a new stack with the same name to be created successfully.

Anahtar Kavram

CloudFormation Stack Lifecycle and Rollback States
Tahmini Süre:1m 30s
Bu soruyu puanla