DVA-C02 · Question #90
A developer is writing unit tests for a new application that will be deployed on AWS. The developer wants to validate all pull requests with unit tests and merge the code with the main branch only whe
The correct answer is C. { "source": "[aws.codecommit]", "detail": { "event": "[pullRequestSourceBranchUpdated]", "event": "[pullRequestCreated]" } }. Option C is correct because it captures both scenarios needed: 'pullRequestCreated' fires when a new pull request is opened, and 'pullRequestSourceBranchUpdated' fires when new commits are pushed to an existing pull request's source branch (i.e., the PR is updated). Together, the
Question
A developer is writing unit tests for a new application that will be deployed on AWS. The developer wants to validate all pull requests with unit tests and merge the code with the main branch only when all tests pass. The developer stores the code in AWS CodeCommit and sets up AWS CodeBuild to run the unit tests. The developer creates an AWS Lambda function to start the CodeBuild task. The developer needs to identify the CodeCommit events in an Amazon EventBridge event that can invoke the Lambda function when a pull request is created or updated. Which CodeCommit event will meet these requirements? A. B. C. D.
Exhibits
Options
- A{ "source": "[aws.codecommit]", "detail": { "event": "[pullRequestMergeStatusUpdated]" } }
- B{ "source": "[aws.codecommit]", "detail": { "event": "[pullRequestApprovalRuleCreated]" } }
- C{ "source": "[aws.codecommit]", "detail": { "event": "[pullRequestSourceBranchUpdated]", "event": "[pullRequestCreated]" } }
- D{ "source": "[aws.codecommit]", "detail": { "event": "[pullRequestUpdated]", "event": "[pullRequestSourceBranchCreated]" } }
How the community answered
(35 responses)- A31% (11)
- B14% (5)
- C46% (16)
- D9% (3)
Explanation
Option C is correct because it captures both scenarios needed: 'pullRequestCreated' fires when a new pull request is opened, and 'pullRequestSourceBranchUpdated' fires when new commits are pushed to an existing pull request's source branch (i.e., the PR is updated). Together, these two events cover the full requirement of triggering the Lambda function whenever a pull request is created or updated with new code changes.
Topics
Community Discussion
No community discussion yet for this question.

