AWS Certified SysOps Administrator – Associate (legacy) — Question 298
A user has created a Cloudformation stack. The stack creates AWS services, such as EC2 instances, ELB, AutoScaling, and RDS. While creating the stack it created EC2, ELB and AutoScaling but failed to create RDS. What will Cloudformation do in this scenario?
Answer options
- A. Cloudformation can never throw an error after launching a few services since it verifies all the steps before launching
- B. It will warn the user about the error and ask the user to manually create RDS
- C. Rollback all the changes and terminate all the created services
- D. It will wait for the user's input about the error and correct the mistake after the input
Correct answer: C
Explanation
By default, AWS CloudFormation has the 'Rollback on failure' option enabled, which means if any resource creation fails, it will automatically delete all previously created resources to return the environment to its original state. This prevents orphaned resources and unnecessary charges for a partially deployed stack. Options A, B, and D are incorrect because CloudFormation does not pause for user input or prompt for manual creation during a standard failed stack deployment.