Courseiva
SDLC Automation →easyMultiple Choice

DOP-C02 SDLC Automation Practice Question

A developer is using AWS CodeCommit as a source repository for a CodePipeline. They want to automatically start the pipeline when changes are pushed to the main branch. What is the simplest way to achieve this?

⚠ Common exam trap

A common mix-up: candidates confuse CodeCommit with third-party Git repositories and assume a webhook is required, but CodeCommit integrates natively with EventBridge, not webhooks, making option C a common distractor.

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

✓

Create an Amazon EventBridge rule that triggers the pipeline on CodeCommit 'push to main' events.

Amazon EventBridge can natively capture CodeCommit repository events, such as 'push to main', and directly trigger a CodePipeline execution without any custom code or polling. This is the simplest and most serverless approach, as it requires no additional infrastructure or manual configuration of webhooks.

Answer analysis

Option-by-option breakdown

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

  • ✗

    Add a Lambda function that is invoked by CodeCommit triggers, which then starts the pipeline.

    Why it's wrong here

    CodeCommit triggers can invoke a Lambda function, and that Lambda could call StartPipelineExecution via the AWS SDK, but this is an unnecessary workaround. Amazon EventBridge natively captures CodeCommit repository events and can directly target CodePipeline with a single rule, so adding Lambda simply introduces custom code, extra IAM permissions, and another failure point. The trigger also has to be carefully wired to parse the commit and branch details, whereas EventBridge provides the event payload automatically. For a native, low-maintenance solution, EventBridge is clearly the better choice.

  • ✗

    Configure the pipeline to poll the CodeCommit repository every 5 minutes.

    Why it's wrong here

    CodePipeline can periodically poll the CodeCommit repository for changes, but polling runs on a fixed interval (for example, every 5 minutes) and does not trigger the pipeline in real time. This means a push can sit idle for up to the polling interval before the pipeline starts, adding unnecessary latency to delivery. Polling also makes extra API calls to CodeCommit even when no changes exist, which is less efficient than the event-driven push model. EventBridge rules are triggered immediately on the push, eliminating both the delay and the need for constant polling.

  • ✗

    Use a webhook from CodeCommit to the pipeline.

    Why it's wrong here

    CodePipeline does support webhooks for external providers like GitHub and Bitbucket, but it does not support an outbound webhook from AWS CodeCommit to the pipeline. CodeCommit is an AWS-native service, and its integration with CodePipeline is designed around EventBridge events, not webhook URLs. Trying to use a webhook would require standing up a custom API endpoint to receive notifications and then translating them into pipeline starts, which is needlessly complex. AWS's native event bridge is the supported, standard mechanism for CodeCommit to CodePipeline.

  • ✓

    Create an Amazon EventBridge rule that triggers the pipeline on CodeCommit 'push to main' events.

    Why this is correct

    EventBridge is the recommended method for triggering a CodePipeline on CodeCommit pushes. You create a rule with a source of aws.codecommit and an event pattern that matches the codecommit:ReferenceCreated or codecommit:ReferenceUpdated event, and then filter by the branch referenceName, for example "main". The rule targets the CodePipeline pipeline, and the pipeline starts nearly instantly after the push. This approach is fully managed, has no custom code, supports precise branch filtering, and is the AWS-prescribed best practice for CodeCommit source actions.

Quick reference

Cloud Service Model Comparison

ModelYou ManageProvider ManagesExamples
IaaSOS, runtime, apps, dataHardware, hypervisor, networkingEC2, Azure VMs, GCP Compute Engine
PaaSApps and dataOS, runtime, middleware, hardwareElastic Beanstalk, Azure App Service
SaaSData and settings onlyEverything elseMicrosoft 365, Salesforce, Workday
FaaS / ServerlessFunction code onlyInfra, scaling, runtimeLambda, Azure Functions, Cloud Run
CaaSContainers and appsKubernetes, OS, hardwareEKS, AKS, GKE

About these practice questions

This DOP-C02 question is part of Courseiva's 1,298-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

Same concept, more angles

1 more way this is tested on DOP-C02

These questions test the same concept from different angles. Work through them to make sure you can recognise it however the exam phrases it.

Variation 1. A development team uses AWS CodeCommit for source control and AWS CodePipeline for CI/CD. The pipeline has a Source stage that polls the repository for changes. Recently, developers have noticed that the pipeline does not always trigger when code is pushed to the main branch. What is the most likely cause?

medium
  • ✓ A.The number of pushes to the repository has exceeded the CodePipeline poll rate limit.
  • B.The repository does not have a webhook configured to notify CodePipeline of changes.
  • C.The IAM role used by CodePipeline does not have permission to read from CodeCommit.
  • D.CloudWatch Events is not enabled for the repository.

Why A: CodePipeline uses a polling mechanism to check for changes in CodeCommit repositories. When the number of pushes exceeds the default poll rate limit (typically one request per 15 seconds), the pipeline may miss some changes, leading to inconsistent triggering. This is a known limitation of polling-based detection, especially in high-velocity development environments.

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.