config_management Flashcards

1
Q

You are deploying a CloudFormation stack and encounter an error during resource creation. By default, what happens to the resources that were successfully created before the failure?
A) CloudFormation leaves the successfully created resources as they are.
B) CloudFormation rolls back the entire stack and deletes all resources.
C) CloudFormation marks the stack as failed but keeps the resources.
D) CloudFormation automatically retries the resource creation process.

A

B) CloudFormation rolls back the entire stack and deletes all resources.
Explanation: By default, CloudFormation attempts to maintain consistency by rolling back all changes if any resource fails during creation. This rollback ensures that no partial or incomplete resources are left running, preventing a misconfigured or inconsistent environment. AWS documentation states, ‘If stack creation fails, CloudFormation rolls back and deletes all resources, so you don’t incur any costs for resources that were only partially created.’

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
2
Q

During a CloudFormation stack update, an error occurs while updating one of the resources. CloudFormation starts to roll back the changes, but the rollback itself fails. What is the likely outcome?
A) The stack is left in the ROLLBACK_COMPLETE state.
B) The stack is marked as ROLLBACK_FAILED and manual intervention is required.
C) The stack is deleted along with all associated resources.
D) The rollback will continue to retry until successful.

A

B) The stack is marked as ROLLBACK_FAILED and manual intervention is required.
Explanation: When a rollback fails, CloudFormation cannot return the stack to its previous stable state. The stack is marked as ROLLBACK_FAILED, and you must manually fix the issue that caused the failure before retrying the rollback or deleting the stack. AWS says, ‘If a rollback fails, the stack is in the ROLLBACK_FAILED state and requires manual intervention to address the issue.’

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
3
Q

You need to troubleshoot a CloudFormation stack that failed during creation. However, you want to keep the resources that were successfully created for debugging. What should you do?
A) Enable rollback and view the stack logs.
B) Set DisableRollback to true in the CloudFormation template.
C) Delete the stack and create it again with different parameters.
D) Use AWS CloudTrail to monitor stack events.

A

B) Set DisableRollback to true in the CloudFormation template.
Explanation: By setting DisableRollback to true, CloudFormation will not delete any successfully created resources if the stack fails. This is useful for debugging and investigating the failure without losing partial resources. According to AWS, ‘If you set the DisableRollback option, CloudFormation keeps any resources that were successfully created, which can help with troubleshooting.’

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
4
Q

An EC2 instance in your CloudFormation stack fails to launch due to insufficient instance capacity in the region. The stack has several other resources that were created successfully. What will the stack status be after the failure, assuming rollback is enabled?
A) CREATE_COMPLETE
B) ROLLBACK_COMPLETE
C) UPDATE_ROLLBACK_FAILED
D) UPDATE_COMPLETE

A

B) ROLLBACK_COMPLETE
Explanation: When rollback is enabled and a stack creation fails, CloudFormation rolls back all resources to their previous state (or deletes them if it’s a new stack). Once the rollback is successful, the stack status will be ROLLBACK_COMPLETE. AWS notes, ‘If an error occurs during stack creation and rollback is successful, the stack status will be ROLLBACK_COMPLETE, indicating that no resources were created.’

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
5
Q

A CloudFormation stack update fails due to an issue with updating a resource, but rollback has been disabled. What will happen to the resources created before the failure?
A) The resources created before the failure will persist, and the stack will be in a CREATE_FAILED state.
B) The stack will be automatically deleted along with all the resources.
C) The stack will be marked as ROLLBACK_FAILED and require manual rollback.
D) CloudFormation will retry the stack update until it succeeds.

A

A) The resources created before the failure will persist, and the stack will be in a CREATE_FAILED state.
Explanation: If rollback is disabled, CloudFormation does not attempt to delete the resources created before the failure. Instead, it leaves the stack in its current state with the status CREATE_FAILED or UPDATE_FAILED, allowing you to troubleshoot and make necessary adjustments. AWS says, ‘When rollback is disabled, CloudFormation leaves the created resources intact, allowing for debugging. The stack will be in a CREATE_FAILED or UPDATE_FAILED state.’

How well did you know this?
1
Not at all
2
3
4
5
Perfectly