DOP-C02 Question 1
Select 2Your organization uses AWS CodePipeline to deploy a microservices-based application. The development team has requested that the pipeline should automatically trigger a rollback to the previous version if the integration tests fail during the staging phase. Which combination of steps will fulfill this requirement?
- A
Add a manual approval action after the staging phase to allow rollback decisions.
- B
Configure an AWS Lambda function in the staging phase to detect test failures and invoke an API call to initiate a rollback.
- C
Use AWS CodeDeploy with a deployment configuration that supports automatic rollbacks.
- D
Enable the 'Automatically roll back on failure' option in the staging phase of AWS CodePipeline.
- E
Add an 'Invoke AWS Lambda function' action in the pipeline to monitor test results and trigger a rollback.
Show answer and explanation
Correct answers: B, C
Explanation
To implement automatic rollbacks when integration tests fail during the staging phase, you can use AWS Lambda to detect failures and trigger a rollback. Additionally, AWS CodeDeploy provides built-in rollback support, which can be leveraged in conjunction with deployment configurations. Together, these options enable a fully automated rollback mechanism without manual intervention.
- A. Incorrect.
Adding a manual approval action does not automate the rollback process and requires human intervention, which does not meet the requirement for automatic rollback.
- B. Correct.
Using an AWS Lambda function to detect test failures and trigger a rollback is a valid approach that allows automation of the rollback process when integration tests fail.
- C. Correct.
AWS CodeDeploy supports automatic rollbacks if configured correctly, making this a suitable option for the scenario.
- D. Incorrect.
AWS CodePipeline does not natively support an 'Automatically roll back on failure' option in the staging phase. Rollback functionality must be implemented through other services or custom logic.
- E. Incorrect.
While invoking an AWS Lambda function can be part of the solution, simply monitoring test results is not sufficient unless it explicitly triggers a rollback. This option lacks the necessary detail to meet the requirement.