DOP-C02 exam dumps

DOP-C02 practice question 81 of 411

AWS Certified DevOps Engineer - Professional. Professional level, Amazon Web Services. Free question with the correct answer and a full explanation.

DOP-C02 Question 81

Single answer

You are managing an infrastructure as code (IaC) setup using AWS CloudFormation for a multi-tier web application. During deployment, the stack creation fails due to a misconfigured security group rule. You need to ensure stack creation or updates automatically roll back to the previous working state to maintain consistency. How can you achieve this in CloudFormation?

  1. A

    Enable the 'Rollback on Failure' option in the CloudFormation stack settings.

  2. B

    Use a CloudFormation Change Set to preview changes and manually approve them before deployment.

  3. C

    Define an AWS Lambda-backed custom resource to handle rollbacks explicitly.

  4. D

    Enable AWS Config rules to automatically detect and remediate misconfigurations during stack creation.

Show answer and explanation

Correct answer: A

Explanation

The 'Rollback on Failure' option in AWS CloudFormation is designed to automatically roll back stack creation or updates when an error occurs. This ensures that the infrastructure remains in a consistent and functional state without requiring manual intervention. While Change Sets, custom resources, and AWS Config rules offer powerful capabilities, they do not provide automatic rollback for failed stack operations.

  • A. Correct.

    This is the correct answer. 'Rollback on Failure' in CloudFormation ensures that if a stack creation or update fails, CloudFormation automatically rolls back to the last stable state. This is a built-in feature of CloudFormation.

  • B. Incorrect.

    While CloudFormation Change Sets allow you to preview what changes will be made to your resources, they do not automatically roll back failed deployments. This option is not sufficient for automatic rollback.

  • C. Incorrect.

    AWS Lambda-backed custom resources are used to perform custom operations during stack creation or updates. However, they require explicit implementation and do not provide automatic rollback functionality out of the box.

  • D. Incorrect.

    AWS Config rules are used to evaluate the compliance of AWS resources against defined rules. They can detect and remediate misconfigurations, but they are not directly involved in CloudFormation stack rollback mechanisms.

Timed practice exam

Take a DOP-C02 practice test under exam conditions

75 questions in 180 minutes, drawn from this bank, with a score report and a per-question review when you finish.

Start timed exam