A company uses AWS CloudFormation to deploy a multi-tier web application. The template includes a nested stack for the database layer. When updating the stack, the database stack fails with a 'CREATE_FAILED' status, but the parent stack continues updating other resources. What is the most likely cause and best practice to prevent this?
Trap 1: The parent stack was created without the '--capabilities'…
The '--capabilities' parameter is for acknowledging IAM capabilities, not for rollback behavior.
Trap 2: The nested stack failure automatically triggers a rollback of the…
The default update behavior is to continue on failure, not to automatically trigger a rollback.
Trap 3: The parent stack is configured with 'OnFailure' set to 'DO_NOTHING'
'OnFailure' is a creation-only parameter, and 'DO_NOTHING' is not a valid setting. For update failures, the default is to continue.
- A
The parent stack's update policy is set to 'CONTINUE' by default. To prevent this, set 'OnFailure' to 'ROLLBACK' in the stack update options.
'OnFailure' is a parameter that only applies to stack creation, not updates. The correct parameter for update stack rollback configuration is 'RollbackOnFailure'.
- B
The parent stack was created without the '--capabilities' parameter, so it cannot roll back.
Why wrong: The '--capabilities' parameter is for acknowledging IAM capabilities, not for rollback behavior.
- C
The nested stack failure automatically triggers a rollback of the parent stack, but the rollback also failed.
Why wrong: The default update behavior is to continue on failure, not to automatically trigger a rollback.
- D
The parent stack is configured with 'OnFailure' set to 'DO_NOTHING'. Change it to 'DELETE'.
Why wrong: 'OnFailure' is a creation-only parameter, and 'DO_NOTHING' is not a valid setting. For update failures, the default is to continue.