AWS Certified SysOps Administrator – Associate — Question 395
A SysOps administrator created an AWS CloudFormation template that provisions Amazon EC2 instances, an Elastic Load Balancer (ELB), and an Amazon RDS DB instance. During stack creation, the creation of the EC2 instances and the creation of the ELB are successful. However, the creation of the DB instance fails.
What is the default behavior of CloudFormation in this scenario?
Answer options
- A. CloudFormation will roll back the stack and delete the stack.
- B. CloudFormation will roll back the stack but will not delete the stack.
- C. CloudFormation will prompt the user to roll back the stack or continue.
- D. CloudFormation will successfully complete the stack but will report a failed status for the DB instance.
Correct answer: B
Explanation
By default, if any resource fails to create during stack provisioning, AWS CloudFormation will roll back the stack by deleting the successfully created resources to prevent orphaned assets and charges. However, the stack itself is not deleted; it remains in the ROLLBACK_COMPLETE state so the administrator can review the event logs to troubleshoot the failure. This makes option B the correct behavior, while the other options describe non-default or unsupported CloudFormation actions.