Courseiva
SDLC Automation →mediumMultiple Choice

DOP-C02 SDLC Automation Practice Question

A company uses AWS CodePipeline with a source stage from GitHub (via CodeStar Connections). The pipeline has a build stage using AWS CodeBuild and a deploy stage using AWS CodeDeploy. The team wants to ensure that a new pipeline execution starts automatically whenever a pull request is merged into the main branch. Which configuration change should be made to meet this requirement?

⚠ Common exam trap

The trap here is assuming that polling or manual approvals are required to detect merges, when CodeStar Connections already provide webhook-based automatic triggering.

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

✓

Configure the CodeStar Connection to use a webhook that triggers the pipeline on push events to the main branch.

For GitHub sources, CodePipeline uses CodeStar Connections, which create webhooks. When a pull request is merged, a push event to the target branch occurs, and the webhook automatically starts the pipeline. This is the native, recommended method. Polling is not supported for connections, and custom EventBridge rules or manual approvals do not provide automatic triggering.

Answer analysis

Option-by-option breakdown

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

  • ✗

    Enable the 'Poll for source changes' option on the source action and set the poll interval to 1 minute.

    Why it's wrong here

    Polling for source changes is a legacy mechanism and is not supported for GitHub sources connected via CodeStar Connections. It introduces latency and is not the recommended approach. Enabling it would not reliably trigger on merge events and may cause missed or delayed executions. The correct method uses webhook-based event triggers from the connection.

  • ✗

    Create an Amazon EventBridge rule that monitors GitHub pull request merge events and invokes the pipeline via a Lambda function.

    Why it's wrong here

    While EventBridge can be used with custom event buses, GitHub does not natively publish pull request merge events to the default EventBridge bus. This approach requires significant custom setup and is not the standard integration. CodePipeline's native CodeStar Connection already handles webhook events for push and merge, making this redundant and more complex.

  • ✗

    Add a manual approval action before the source stage that triggers the pipeline when a pull request is merged.

    Why it's wrong here

    Manual approval actions are used to pause a pipeline for human review; they do not trigger pipeline executions. Placing an approval before the source stage is not possible because the source stage must be first. This option misconstrues the purpose of approval actions and does not achieve automatic triggering on merge.

  • ✓

    Configure the CodeStar Connection to use a webhook that triggers the pipeline on push events to the main branch.

    Why this is correct

    CodeStar Connections automatically create webhooks for GitHub repositories. When a push event occurs on the configured branch (e.g., main), the webhook triggers the pipeline. Merging a pull request results in a push to the main branch, so the pipeline starts. This is the intended and supported integration for GitHub sources in CodePipeline.

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

JA

Written and reviewed by Johnson Ajibi, MSc IT Security

Senior Network & Security Engineer · founder of Courseiva

Last reviewed September 2026 · checked against the official Amazon Web Services exam blueprint

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.