Courseiva
SDLC AutomationmediumMultiple ChoiceObjective-mapped

DOP-C02 SDLC Automation Practice Question

A development team uses AWS CodeCommit as a source repository for their AWS CodePipeline. They want to automatically trigger a pipeline execution when a new branch is created. Which solution should they implement?

⚠ Common exam trap

Watch out — candidates often confuse webhooks (which are for external Git providers) with native AWS event-driven triggers, leading them to incorrectly select Option C, or they mistakenly think S3 notifications can be used for CodeCommit events (Option A) due to a general familiarity with S3 event-driven architectures.

Answer choices

Why each option matters

Answer the question above first, then reveal the full breakdown to understand why each option is right or wrong.

Correct answer & explanation

Use Amazon CloudWatch Events to trigger the pipeline on a CodeCommit 'Reference Created' event.

AWS CodePipeline can be configured to start execution automatically when a new branch is created in CodeCommit by using Amazon CloudWatch Events (now part of Amazon EventBridge) to listen for the 'Reference Created' event type. This event is emitted by CodeCommit whenever a new Git reference (such as a branch or tag) is created, and it can directly target a CodePipeline pipeline as a rule target, triggering a new execution without any custom polling or webhook setup.

Answer analysis

Option-by-option breakdown

For each option: why learners choose it and why it is or isn't the right answer here.

  • Create an S3 event notification to invoke the pipeline when a branch is created.

    Why it's wrong here

    S3 event notifications are designed only for object-level operations within an Amazon S3 bucket (e.g., s3:ObjectCreated:*). CodeCommit repository events, such as branch creation, are not S3 events and cannot be captured by S3 notification rules. Even if you attempted to use S3 as a bridge, you would need a Lambda function to poll or receive some other signal, making this neither native nor directly capable of invoking a CodePipeline upon a Git reference creation.

  • Use Amazon CloudWatch Events to trigger the pipeline on a CodeCommit 'Reference Created' event.

    Why this is correct

    Amazon CloudWatch Events (now Amazon EventBridge) natively captures CodeCommit API events, including a 'Reference Created' event when a branch or tag is created. You can configure a rule that matches the repository name and reference type 'branch', then target it to the CodePipeline pipeline for automatic execution. This is the recommended push-based integration because it is serverless, near-real-time, and does not require any external endpoint or polling.

  • Configure a webhook in CodePipeline to detect branch creation events.

    Why it's wrong here

    CodePipeline webhooks are an integration mechanism for external or on-premises source repositories such as GitHub Enterprise Server, Bitbucket, or Azure DevOps, allowing them to notify the pipeline of changes. CodeCommit, however, is an AWS-native service that already integrates with CodePipeline via Amazon EventBridge, so CodePipeline does not support webhook configuration for CodeCommit as a source action. Creating a webhook for CodeCommit would be conceptually invalid because CodeCommit does not issue HTTP callbacks to a webhook URL.

  • Set up a polling mechanism in CodePipeline to check for new branches every minute.

    Why it's wrong here

    CodePipeline's source action for CodeCommit does not support a user-configured polling interval; it relies on Amazon CloudWatch Events for automatic triggers. For third-party actions (such as Jenkins), CodePipeline uses periodic polling, but that is not applicable to CodeCommit repositories. A hypothetical 'check every minute' mechanism would be inefficient, add latency, and fail to capture branch creation events as they occur, since no Amazon resource is configured to report the 'Reference Created' event to the pipeline.

About these practice questions

This DOP-C02 question is part of Courseiva's 251-question bank — original exam-style content with full explanations and wrong-answer analysis, never real exam questions or exam dumps. Learn why practice questions differ from exam dumps →

How Courseiva writes practice questions · Editorial policy

JA

Written by Johnson Ajibi, MSc IT Security

Senior Network & Security Engineer · founder of Courseiva

This DOP-C02 practice question is part of Courseiva's free Amazon Web Services certification practice question bank. Courseiva provides original exam-style practice questions with explanations, topic-based practice, mock exams, readiness tracking, and study analytics to help learners prepare for the DOP-C02 exam.