DOP-C02 Question 212
Single answerYour company is using AWS CodePipeline for its CI/CD process. The pipeline contains a build stage that leverages AWS CodeBuild. Recently, developers have noticed that the build stage sometimes fails due to transient issues, such as network instability or temporary unavailability of external dependencies. As a DevOps Engineer, you are tasked with minimizing these transient build failures without requiring developers to manually re-trigger the pipeline. Which configuration change should you implement?
- A
Enable retries in the buildspec file for the CodeBuild project.
- B
Configure the build stage in CodePipeline to automatically retry on failure.
- C
Increase the instance type for the CodeBuild environment to handle transient issues.
- D
Set up an Amazon EventBridge rule to monitor failed builds and trigger a notification for manual intervention.
Show answer and explanation
Correct answer: B
Explanation
To address transient build failures, CodePipeline provides the capability to configure automatic retries for pipeline stages, including the build stage. This ensures that temporary issues do not cause the entire pipeline to fail, thereby improving overall reliability without requiring manual intervention. Other options, such as modifying the buildspec file or increasing the instance type, do not directly address the requirement to minimize transient failures through automated retries.
- A. Incorrect.
CodeBuild buildspec files define the build process steps but do not provide a mechanism for retrying failed builds. Retries must be configured at the pipeline or service level.
- B. Correct.
CodePipeline allows you to configure automatic retries for stages, including the build stage. This is the correct way to address transient build failures without manual intervention.
- C. Incorrect.
Increasing the instance size of the CodeBuild environment may improve performance but is unlikely to resolve transient issues caused by external dependencies or network instability.
- D. Incorrect.
Setting up an EventBridge rule to monitor failed builds can notify you of issues, but it does not automatically address or retry failures, which is the goal in this scenario.