exam questions

Exam AWS Certified DevOps Engineer - Professional DOP-C02 All Questions

View all questions & answers for the AWS Certified DevOps Engineer - Professional DOP-C02 exam

Exam AWS Certified DevOps Engineer - Professional DOP-C02 topic 1 question 69 discussion

A development team uses AWS CodeCommit, AWS CodePipeline, and AWS CodeBuild to develop and deploy an application. Changes to the code are submitted by pull requests. The development team reviews and merges the pull requests, and then the pipeline builds and tests the application.
Over time, the number of pull requests has increased. The pipeline is frequently blocked because of failing tests. To prevent this blockage, the development team wants to run the unit and integration tests on each pull request before it is merged.
Which solution will meet these requirements?

  • A. Create a CodeBuild project to run the unit and integration tests. Create a CodeCommit approval rule template. Configure the template to require the successful invocation of the CodeBuild project. Attach the approval rule to the project's CodeCommit repository.
  • B. Create an Amazon EventBridge rule to match pullRequestCreated events from CodeCommit Create a CodeBuild project to run the unit and integration tests. Configure the CodeBuild project as a target of the EventBridge rule that includes a custom event payload with the CodeCommit repository and branch information from the event.
  • C. Create an Amazon EventBridge rule to match pullRequestCreated events from CodeCommit. Modify the existing CodePipeline pipeline to not run the deploy steps if the build is started from a pull request. Configure the EventBridge rule to run the pipeline with a custom payload that contains the CodeCommit repository and branch information from the event.
  • D. Create a CodeBuild project to run the unit and integration tests. Create a CodeCommit notification rule that matches when a pull request is created or updated. Configure the notification rule to invoke the CodeBuild project.
Show Suggested Answer Hide Answer
Suggested Answer: B 🗳️

Comments

Chosen Answer:
This is a voting comment (?). It is better to Upvote an existing comment if you don't have anything to add.
Switch to a voting comment New
haazybanj
Highly Voted 1 year, 3 months ago
Selected Answer: B
To run the unit and integration tests on each pull request before it is merged, a solution that listens to pullRequestCreated events and runs a CodeBuild project to execute tests would be the most appropriate option. Option B describes a solution that creates an Amazon EventBridge rule to match pullRequestCreated events from CodeCommit and configures a CodeBuild project to run the unit and integration tests, passing the CodeCommit repository and branch information from the event as a custom payload. Therefore, option B is the correct answer.
upvoted 12 times
...
that1guy
Most Recent 2 months, 3 weeks ago
Selected Answer: C
These days it would be C instead of B, it's very common to reuse the same pipeline but with conditions to skip certain steps depending on the branch. https://aws.amazon.com/blogs/devops/aws-codepipeline-adds-support-for-branch-based-development-and-monorepos/
upvoted 1 times
...
jojom19980
5 months, 3 weeks ago
Selected Answer: A
The Answer should Be A because this option is allows test the code and the approval is depending on test's result
upvoted 2 times
vn_thanhtung
2 months, 2 weeks ago
The development team reviews and merges the pull requests, and then the pipeline builds and tests the application.
upvoted 1 times
Jon_aws
4 days, 12 hours ago
shouldn't review be after build and test?
upvoted 1 times
...
...
...
thanhnv142
6 months, 1 week ago
A is definitely correct: <The development team reviews and merges the pull requests> and <the development team wants to run the unit and integration tests on each pull request before it is merged> means the dev team always review all pull requests and they need a solution to test committed code before merging to main. option A allow them to do tests and manually approve it before allow merging B C and D: no mention of the step that allow the dev team to manually approve the merge.
upvoted 2 times
...
2pk
9 months ago
B is the answer . D is wrong. Code commit only can setup notification rule to SNS topics or Chatbot.
upvoted 2 times
...
BaburTurk
11 months ago
Selected Answer: B
https://aws.amazon.com/blogs/devops/validating-aws-codecommit-pull-requests-with-aws-codebuild-and-aws-lambda/
upvoted 3 times
...
Seoyong
11 months, 3 weeks ago
Selected Answer: D
Only D covers create pull request and update pull request
upvoted 1 times
zolthar_z
8 months, 2 weeks ago
Can't be D because you can trigger a Codebuild project with CodeCommit notification rules
upvoted 2 times
...
...
Aja1
1 year ago
Option B is the most appropriate solution as it uses Amazon EventBridge rules to automatically trigger a CodeBuild project for running tests on each pull request, enabling early testing and preventing pipeline blockages due to failing tests after merging.
upvoted 1 times
...
totopopo
1 year ago
Selected Answer: D
Nothing in requirements says that the team wants a blockage of the pull request merge. And the B solution talks only about the "PullRequestCreated" which is not enough, it has to be reexecuted at any event on the pull request.
upvoted 3 times
...
Snape
1 year ago
Selected Answer: B
A wrong: Dev team will need to manually approve each pull request before merging, this can be time consuming and error-prone. C Wrong: Modifying the exisiting codepipeline is not necessary D wrong: No preventiong from pipeline being blocked by failing tests
upvoted 3 times
...
Community vote distribution
A (35%)
C (25%)
B (20%)
Other
Most Voted
A voting comment increases the vote count for the chosen answer by one.

Upvoting a comment with a selected answer will also increase the vote count towards that answer by one. So if you see a comment that you already agree with, you can upvote it instead of posting a new comment.

SaveCancel
Loading ...
exam
Someone Bought Contributor Access for:
SY0-701
London, 1 minute ago