DOP-C02 exam dumps

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

Single answer

Your company uses AWS CodePipeline for CI/CD, and you have a deployment stage configured to deploy an application to an Amazon ECS service using AWS CodeDeploy. Recently, deployments have been failing due to application errors found in the post-deployment validation step. The team has requested a solution to automatically roll back the deployment if these errors occur. How can you implement this in the most efficient way?

  1. A

    Enable the 'Automatic Rollback on Deployment Failure' setting in the CodeDeploy deployment group.

  2. B

    Modify the CodePipeline stage to include a manual approval step after deployment.

  3. C

    Configure an Amazon CloudWatch alarm to monitor the ECS service and trigger a rollback if the alarm is breached.

  4. D

    Write a custom Lambda function to monitor deployment events and programmatically trigger a rollback on failure.

Show answer and explanation

Correct answer: A

Explanation

AWS CodeDeploy provides a built-in 'Automatic Rollback on Deployment Failure' feature that simplifies rollback handling without requiring additional configurations or custom logic. This is the most efficient and recommended approach for handling deployment failures in ECS services managed by CodeDeploy.

  • A. Correct.

    This is the correct solution. Enabling the 'Automatic Rollback on Deployment Failure' setting in the deployment group will ensure that CodeDeploy automatically reverts to the previous version if errors occur during the deployment.

  • B. Incorrect.

    Adding a manual approval step introduces unnecessary human intervention and doesn't address the rollback requirement automatically.

  • C. Incorrect.

    While monitoring with a CloudWatch alarm is useful for ongoing application health, it is not the most direct or efficient way to implement automatic rollback in CodeDeploy.

  • D. Incorrect.

    Although writing a custom Lambda function could achieve the desired behavior, it requires additional effort and maintenance, making it a less efficient solution compared to using the built-in rollback feature.

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