A SysOps admin deployed a CloudFormation template that creates EC2 instances, an Elastic Load Balancer, and an RDS DB instance. The EC2 instances and the load balancer were created successfully, but DB creation failed. By default, how does CloudFormation behave in this situation?
Choose an answer
Tap an option to check your answer.
Correct answer: CloudFormation will roll back the stack but will not delete the stack..
Why this is the answer
By default, if a resource creation fails during a CloudFormation stack creation, CloudFormation attempts to roll back the entire stack to its previous stable state. This means it will delete any resources that were successfully created during the failed stack creation attempt. However, it will not delete the stack itself; the stack will remain in a ROLLBACKCOMPLETE state, indicating that the creation failed and was rolled back. The other options are incorrect: "CloudFormation will roll back the stack and delete the stack" is incorrect because the stack itself is not deleted, only the resources within it. "CloudFormation will prompt the user to choose..." is incorrect; CloudFormation's default behavior is automatic rollback without user intervention. "CloudFormation will finish creating the stack but will mark the DB instance resource as failed" is incorrect because CloudFormation stops stack creation upon failure and initiates a rollback, rather than continuing with failed resources.
Pass your exam — without the endless answer hunt
Get every verified question and explanation for this exam in one place, and save hours of prep. 1,000+ certifications · 20+ languages · free to start.
Pass your exam faster → No card needed