Exam SOA-C02 All QuestionsBrowse all questions from this exam
Question 164

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?

    Correct Answer: A

    When an AWS CloudFormation stack creation process fails, CloudFormation rolls back any changes to ensure consistent state, which involves deleting any successfully created resources up to the point of failure. The default behavior is that CloudFormation will delete the stack. This means the instances and the ELB will also be deleted.

Discussion
trajaOption: B

Ans is B. It will delete all the resources in the stack but stack deletion will be manual.

Andrew_AOption: B

CloudFormation will delete the resources it created during the stack creation attempt but it will not remove the stack record itself. This allows you to review the stack events and troubleshoot the reason for failure. I hope this clarifies the matter.

VivecOption: B

By default, when a resource creation fails during the creation of a CloudFormation stack, CloudFormation will roll back the stack to its previous state, undoing any changes made to the stack. Therefore, the answer is B. CloudFormation will roll back the stack but will not delete the stack. This allows the administrator to troubleshoot the issue that caused the failure and attempt to create the stack again.

SomboonCHOption: A

I think A The rollback-stack operation will delete a stack if it doesn't contain a last known stable state. https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/stack-failure-options.html

King_AWS_202Option: B

CloudFormation will not delete the stack by default. If you want CloudFormation to delete the stack if it rolls back, you need to specify the DeletionPolicy property in the template. The DeletionPolicy property can have three values: Delete - CloudFormation will delete the stack and all of its resources. Retain - CloudFormation will not delete the stack or any of its resources. Snapshot - CloudFormation will create a snapshot of the DB instance and then delete the stack. In this case, the default behavior is to roll back the stack and not delete the stack.

MrMLBOption: B

B. CloudFormation will roll back the stack but will not delete the stack. In AWS CloudFormation, if the creation of a resource within a stack fails, CloudFormation will roll back the entire stack to its previous state. This means that any resources that were created successfully will be deleted, and the stack will be returned to the state it was in before the stack creation began. However, CloudFormation does not delete the stack itself in this scenario. Instead, the stack remains in a failed state, and the administrator can choose to roll back the stack or continue with the stack creation.

Gomer

Second quote blurs the distinction between A and B, but I think answer is still B. I actually creating a stack it with a template with an intentional error (acloud.guru demo/lab file). The stack roll back out as expected and the stack did not delete itself, and I still had the stack listed under the "stacks" menu. Even though it had known error and never had a "last known stable state", I saw it listed in stacks menu, and I wasn't able to create another stack using the "TestStack stack (e.g. Error "Stack name allready exists") Don't mean to ramble on here, but sometimes the AWS exam questions and answers don't exactly match the reality in the AWS console. Facts: (*) "Roll back all stack resources" (default setting from CloudFormation create stack menu) "Specify the rollback-stack operation to roll back a stack to its last stable state." "Note: The rollback-stack operation will delete a stack if it doesn't contain a last known stable state." https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/stack-failure-options.html

awsguru1998

B CloudFormation will roll back the stack in the event of a failed resource. It will not delete the stack automatically, and will instead leave it in a failed state. The user will then have the option to roll back the stack manually or continue with the stack in its failed state.

michaldavidOption: B

bbbbbbb

XelnakOption: A

A for sure

10cc6baOption: A

A. CloudFormation will roll back the stack and delete the stack. Explanation: When a stack creation fails, AWS CloudFormation automatically rolls back all resources that were created up to the point of failure. This behavior is intended to ensure that partial and potentially unstable stacks are not left in your account. This rollback operation includes deleting any resources that were successfully created before the failure occurred. This means that both the EC2 instances and the Elastic Load Balancer will be deleted since the creation of the DB instance failed. This automatic rollback is the default behavior unless you explicitly specify otherwise by disabling rollback.

anderri

A "If the stack updates fails, CloudFormation rolls back changes to restore the stack to the last known working state." Restore the stack means deleting the new objects created during the stack.

defmania00

Yes, but it won't delete the stack, just de objects it created.

Deeezz

The answer is A. Reference ....https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/cfn-whatis-howdoesitwork.html

Deeezz

"After all the resources have been created, CloudFormation reports that your stack has been created. You can then start using the resources in your stack. If stack creation fails, CloudFormation rolls back your changes by deleting the resources that it created." - AWS

joanneli77

....annnnd the stack remains. Even with "Create Failed" status, you can highlight then delete the stack... this means the stack is not deleted. It's rolled back. If the stack is created the first time, the rollback is to no objects, but the stack remains, effectively empty. The answer is B.

skywalkerOption: A

I think is A... it will attempt to delete the stack and rolback...

Pepepep

It is B. https://stelligent.com/2020/08/17/removing-errors-on-cloudformation-stack-creation/

CloudHandsOn

Answer is B. Stack will need to be deleted manually

beznika

B. CloudFormation default behavior is to rolback but the stack needs to be removed manually.