DOP-C02 · Question #391
DOP-C02 Question #391: Real Exam Question with Answer & Explanation
The correct answer is A: Create an IAM service role to allow access to the resources that are required to run the tests.. CodeBuild needs an IAM service role to pull your source, write logs, report build status, and upload artifacts to S3, so defining that role is required. A CodeBuild project with webhook triggers on pull-request events and “build status reporting” enabled will automatically run yo
Question
A company has application code in an AWS CodeConnections compatible Git repository. The company wants to configure unit tests to run when pull requests are opened. The company wants to ensure that the test status is visible in pull requests when the tests are completed. The company wants to save output data files that the tests generate to an Amazon S3 bucket after the tests are finished. Which combination of solutions will meet these requirements? (Choose three.)
Options
- ACreate an IAM service role to allow access to the resources that are required to run the tests.
- BCreate a pipeline in AWS CodePipeline that has a test stage. Create a trigger to run the pipeline
- CCreate an AWS CodeBuild project to run the tests. Enable webhook triggers to run the tests when
- DCreate a buildspec.yml file that has a reports section to upload output files when the tests have
- ECreate a buildspec.yml file that has an artifacts section to upload artifacts when the tests have
- FCreate an appspec.yml file that has a files section to upload output files when the tests have
Explanation
CodeBuild needs an IAM service role to pull your source, write logs, report build status, and upload artifacts to S3, so defining that role is required. A CodeBuild project with webhook triggers on pull-request events and “build status reporting” enabled will automatically run your unit tests on each PR and post pass/fail back to the PR. In your buildspec.yml, the artifacts section tells CodeBuild which files to bundle and push to an S3 bucket when the build (your tests) completes.
Topics
Community Discussion
No community discussion yet for this question.