Question

Difficulty: MediumTroubleshooting CloudFormation and CI/CD Deployments

An organization's deployment pipeline fails during a step that executes an AWS CloudFormation stack template. The pipeline is configured to update a stack that has a status of ROLLBACK_COMPLETE following a failed initial creation attempt. Which actions should a developer take to resolve this issue and enable a successful deployment? (Choose two.)

  1. Delete the CloudFormation stack in the ROLLBACK_COMPLETE state.Answer
  2. Resolve the underlying resource configuration issue that caused the initial creation failure.Answer
  3. C
    Initiate a stack update operation using the corrected template directly on the existing stack.
  4. D
    Add the cloudformation:UpdateStack permission to the trust policy of the IAM service role.
  5. E
    Run a drift detection operation on the stack and import the failed resources to force the state to UPDATE_COMPLETE.

Answer

Delete the CloudFormation stack in the ROLLBACK_COMPLETE state and resolve the underlying resource configuration issue that caused the initial creation failure.
To resolve a failed initial deployment that resulted in a ROLLBACK_COMPLETE state, the developer must delete the stack and fix the root cause of the failure. CloudFormation does not allow updates to stacks that failed their initial creation (ROLLBACK_COMPLETE). Once the stack is deleted and the template/environment issues are resolved, the pipeline can successfully trigger a new stack creation.

Step-by-Step Solution

1
Analyze the CloudFormation event logs to identify the resource and reason that caused the initial creation failure.
The root cause of the deployment failure is understood.
Understanding why the initial deployment failed is necessary to correct the template or parameters.
2
Delete the failed stack that is in the ROLLBACK_COMPLETE state.
The stack name is freed up, and the failed stack is removed.
Stacks that fail initial creation reach ROLLBACK_COMPLETE and cannot be updated. They must be deleted before a new stack can be created.
3
Fix the template or environment issues and trigger the CI/CD pipeline to redeploy.
A new stack is successfully created.
Running the pipeline with the corrected configuration creates a fresh stack without hitting the previous errors.

Key Concept

Managing CloudFormation stack states and resolving failed initial creations in a CI/CD pipeline.
Rate this question