Learn the correct parameter to set in AWS CloudFormation to preserve successfully created resources if stack creation fails. Discover the solution for SysOps administrators.
Table of Contents
Question
A SysOps administrator is troubleshooting an AWS CloudFormation stack creation that failed. Before the SysOps administrator can identify the problem, the stack and its resources are deleted. For future deployments, the SysOps administrator must preserve any resources that CloudFormation successfully created.
What should the SysOps administrator do to meet this requirement?
A. Set the value of the DisableRollback parameter to False during stack creation
B. Set the value of the OnFailure parameter to DO_NOTHING during stack creation
C. Specify a rollback configuration that has a rollback trigger of DO_NOTHING during stack creation
D. Set the value of the OnFailure parameter to ROLLBACK during stack creation
Answer
B. Set the value of the OnFailure parameter to DO_NOTHING during stack creation
Explanation
To preserve any resources that AWS CloudFormation successfully creates during a failed stack deployment, the SysOps administrator should set the value of the OnFailure parameter to DO_NOTHING during stack creation.
When creating a CloudFormation stack, there are several parameters that control how the stack handles failures:
- DisableRollback: If set to False (default), CloudFormation rolls back the stack if stack creation fails. This deletes all created resources.
- OnFailure: Determines what CloudFormation does if stack creation fails. It can have values of ROLLBACK, DELETE, or DO_NOTHING.
- Rollback Configuration: Specifies triggers and monitoring time for CloudFormation to monitor the stack and roll back if certain conditions are met.
In this scenario, setting OnFailure to DO_NOTHING instructs CloudFormation to preserve any resources it successfully created if there is an error during stack creation. The stack will be in a CREATE_FAILED state, but resources will not be automatically deleted.
DisableRollback set to False would still delete resources on failure. A rollback configuration with a DO_NOTHING trigger is not applicable, as that relates to rollback after creation. And OnFailure set to ROLLBACK would roll the stack back, deleting created resources.
Therefore, the correct answer is B. Set the value of the OnFailure parameter to DO_NOTHING during stack creation.
Amazon AWS Certified SysOps Administrator – Associate certification exam assessment practice question and answer (Q&A) dump including multiple choice questions (MCQ) and objective type questions, with detail explanation and reference available free, helpful to pass the Amazon AWS Certified SysOps Administrator – Associate exam and earn Amazon AWS Certified SysOps Administrator – Associate certification.