DOP-C02 exam dumps

DOP-C02 practice question 108 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 108

Single answer

Your company is using AWS CodePipeline to automate the deployment of a serverless application. The pipeline has the following stages: Source, Build, Deploy, and Test. During the Deploy stage, the application is deployed to AWS Lambda using AWS CloudFormation. Recently, deployments have been failing intermittently during the Deploy stage due to a race condition between resource updates. How can you address this issue to ensure consistent deployments?

  1. A

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

  2. B

    Add a dependency explicitly in the CloudFormation template to define the order of resource creation.

  3. C

    Increase the build timeout in the Build stage of the pipeline.

  4. D

    Enable retries in AWS CodePipeline for the Deploy stage.

Show answer and explanation

Correct answer: B

Explanation

Race conditions during resource updates in AWS CloudFormation occur when the creation of one resource depends on another, but the dependency is not clearly defined in the template. By explicitly specifying the dependency in the CloudFormation template, you ensure that resources are created or updated in the correct order, eliminating the race condition. Other options, such as enabling rollback or retries, do not solve the root cause of the issue.

  • A. Incorrect.

    Enabling 'Rollback on failure' ensures that the stack is cleaned up when a failure occurs, but it does not address the root cause of the race condition.

  • B. Correct.

    Adding a dependency explicitly in the CloudFormation template ensures that resources are created in a specific order, which resolves race conditions during deployments.

  • C. Incorrect.

    Increasing the build timeout in the Build stage does not affect the Deploy stage or resolve race conditions in resource updates.

  • D. Incorrect.

    Enabling retries in AWS CodePipeline can retry failed deployments, but it does not address the underlying race condition causing the failures.

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