Skip to main content

AWS DVA-C02 Drill: EventBridge CodeCommit Events - Lambda Triggering for PR Validation

Jeff Taakey
Author
Jeff Taakey
21+ Year Enterprise Architect | AWS SAA/SAP & Multi-Cloud Expert.

Jeff’s Note
#

Unlike generic exam dumps, ADH analyzes this scenario through the lens of a Real-World Lead Developer.

For AWS DVA-C02 candidates, the confusion often lies in knowing which CodeCommit event names appear in EventBridge for pull request lifecycle events. In production, this means you need exact event names to properly trigger Lambda functions and automate CI/CD failing or passing gates. Let’s drill down.

The Certification Drill (Simulated Question)
#

Scenario
#

NovaApps is building an automated pipeline to enforce code quality before merging pull requests into their main branch. Developers store application code in AWS CodeCommit. NovaApps uses AWS CodeBuild to run unit tests. To automate triggering tests, a Lambda function is created that starts CodeBuild when pull requests are created or updated.

The team wants to use Amazon EventBridge to detect the correct CodeCommit events representing pull request creation and source branch updates, so the Lambda function can be invoked timely and reliably.

The Requirement:
#

Select the correct Amazon EventBridge detail.event value(s) emitted by AWS CodeCommit to invoke the Lambda when a pull request is either created or its source branch is updated.

The Options
#

  • A) { "source":"aws.codecommit", "detail": { "event":"pullRequestApprovalRuleCreated" } }
  • B) -
  • C) { "source":"aws.codecommit", "detail": { "event":"pullRequestSourceBranchUpdated", "pullRequestCreated" } }
  • D) { "detail":{ "source":"aws.codecommit", "event":"pullRequestUpdated","pullRequestSourceBranchCreated" } }

Google adsense
#

leave a comment:

Correct Answer
#

C

Quick Insight: The Developer Imperative
#

  • The specific CodeCommit EventBridge detail.event values for pull request lifecycle are exact string identifiers.
  • “pullRequestSourceBranchUpdated” and “pullRequestCreated” are the events that correspond to source branch updates and PR creation.
  • Properly filtering on these events enables Lambda triggers to automate CodeBuild runs for PR validation.

Content Locked: The Expert Analysis
#

You’ve identified the answer. But do you know the implementation details that separate a Junior from a Senior?


The Expert’s Analysis
#

Correct Answer
#

Option C

The Winning Logic
#

AWS CodeCommit produces very specific event values in Amazon EventBridge for pull request lifecycle actions. Among these, pullRequestCreated denotes the creation of a pull request, and pullRequestSourceBranchUpdated denotes when the source branch of the PR receives new commits or updates.

For automating CI/CD workflows that kick off unit tests on any new PR or code update within that PR, your Lambda needs to listen exactly to these events.

  • Option C correctly lists these event types together under the "detail": { "event": [...] } structure, making it the suitable trigger.

  • The Lambda can parse EventBridge events with these values and programmatically start the CodeBuild job to run unit tests.

The Trap (Distractor Analysis)
#

  • Why not Option A?
    "pullRequestApprovalRuleCreated" relates to approval rules on a PR but does not trigger on creation or source branch updates. It’s irrelevant for automatic test runs on code changes.

  • Why not Option B?
    Missing option, no context.

  • Why not Option D?
    EventBridge events always have "source" at the top level, not inside "detail". Also, "pullRequestUpdated" and "pullRequestSourceBranchCreated" are not official event names from CodeCommit. These are invalid or malformed event values.


The Technical Blueprint
#

# Example AWS CLI EventBridge rule to capture PR creation and source branch updates:

aws events put-rule \
  --name "TriggerLambdaOnPR" \
  --event-pattern '{
    "source": ["aws.codecommit"],
    "detail-type": ["CodeCommit Pull Request State Change"],
    "detail": {
      "event": ["pullRequestCreated", "pullRequestSourceBranchUpdated"]
    }
  }'

The Comparative Analysis
#

Option API/Event Complexity Accuracy Use Case
A Event relates to approval rules only Low Not suitable for triggering tests on PR creation or update
B No option (missing) N/A N/A
C Correct CodeCommit event names in EventBridge High Matches requirements for triggering Lambda on PR create/update
D Invalid event structure/values Low Does not represent valid EventBridge event syntax

Real-World Application (Practitioner Insight)
#

Exam Rule
#

For the exam, always pick the pullRequestCreated and pullRequestSourceBranchUpdated events when working with CodeCommit PR lifecycle triggers in EventBridge.

Real World
#

In practice, teams extend this with CodePipeline or use AWS CodeBuild’s native integration with CodeCommit triggers. But understanding the underlying EventBridge events unlocks advanced custom workflows and Lambda automation.


(CTA) Stop Guessing, Start Mastering
#


Disclaimer

This is a study note based on simulated scenarios for the AWS DVA-C02 exam.

The DevPro Network: Mission and Founder

A 21-Year Tech Leadership Journey

Jeff Taakey has driven complex systems for over two decades, serving in pivotal roles as an Architect, Technical Director, and startup Co-founder/CTO.

He holds both an MBA degree and a Computer Science Master's degree from an English-speaking university in Hong Kong. His expertise is further backed by multiple international certifications including TOGAF, PMP, ITIL, and AWS SAA.

His experience spans diverse sectors and includes leading large, multidisciplinary teams (up to 86 people). He has also served as a Development Team Lead while cooperating with global teams spanning North America, Europe, and Asia-Pacific. He has spearheaded the design of an industry cloud platform. This work was often conducted within global Fortune 500 environments like IBM, Citi and Panasonic.

Following a recent Master’s degree from an English-speaking university in Hong Kong, he launched this platform to share advanced, practical technical knowledge with the global developer community.


About This Site: AWS.CertDevPro.com


AWS.CertDevPro.com focuses exclusively on mastering the Amazon Web Services ecosystem. We transform raw practice questions into strategic Decision Matrices. Led by Jeff Taakey (MBA & 21-year veteran of IBM/Citi), we provide the exclusive SAA and SAP Master Packs designed to move your cloud expertise from certification-ready to project-ready.