Courseiva
Deployment →hardMultiple Choice

DVA-C02 Deployment Practice Question

A company is using AWS CodePipeline with a multi-branch strategy. The pipeline includes a source stage from AWS CodeCommit, a build stage using AWS CodeBuild, and a deploy stage using AWS CodeDeploy. The team wants to automatically deploy changes only when a pull request is merged to the 'main' branch. Which configuration should be used?

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 a CodeCommit trigger to start the pipeline on push events to the 'main' branch.

Option A is correct because a CodeCommit repository trigger configured for push events on the 'main' branch will start the pipeline exactly when a merge commit is pushed to main, which is the desired behavior for deploying only merged pull requests. This is the standard, event-driven way to integrate CodeCommit with CodePipeline for branch-specific deployments. Option B is wrong because manual approval is a pipeline action that gates a deployment after it has already started, not a trigger mechanism, and it cannot itself detect a pull request merge. Option C is wrong because hourly scheduled runs are not event-driven and would deploy at arbitrary times, potentially including unmerged or stale changes. Option D is wrong because periodic polling is a legacy change-detection method that does not specifically react to a merge to 'main' and adds latency.

Answer analysis

Option-by-option breakdown

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

  • ✓

    Configure a CodeCommit trigger to start the pipeline on push events to the 'main' branch.

    Why this is correct

    Configuring a CodeCommit trigger establishes an event-driven mechanism where CodePipeline automatically starts execution upon detecting a `git push` event to the specified 'main' branch. This includes pushes resulting from direct commits or successful pull request merges, ensuring immediate and efficient pipeline initiation without manual intervention or polling overhead.

  • ✗

    Create a manual approval step before deployment and require a pull request merge as a trigger.

    Why it's wrong here

    A manual approval step is designed to pause pipeline execution, awaiting explicit human intervention before proceeding, rather than initiating it. While a pull request merge results in a push, requiring manual approval *before* deployment does not automatically *trigger* the pipeline; it introduces a deliberate gate that prevents continuous delivery.

  • ✗

    Use a scheduled trigger to run the pipeline every hour and check for changes.

    Why it's wrong here

    Using a scheduled trigger to run the pipeline every hour is inefficient because it executes regardless of whether new code changes have been pushed. This time-based approach can lead to unnecessary resource consumption and increased operational costs from redundant builds, while also introducing latency if changes occur immediately after a scheduled run.

  • ✗

    Configure the source stage to use the 'main' branch and enable periodic polling.

    Why it's wrong here

    Enabling periodic polling in the source stage instructs CodePipeline to periodically check the 'main' branch for changes, typically every five minutes. Although it detects updates, polling is less efficient than event-driven triggers as it consumes resources continuously and introduces a delay between a code push and pipeline initiation, rather than reacting instantly.

About these practice questions

One of 1,135 original DVA-C02 practice questions on Courseiva, each with a full explanation and wrong-answer analysis — not exam dumps or protected exam content. 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 DVA-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 DVA-C02 exam.