Courseiva

DOP-C02 Configuration Management and IaC Practice Question

Which TWO actions should a DevOps engineer take to implement a GitFlow branching strategy for infrastructure as code using AWS CodeCommit and CodePipeline? (Choose two.)

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 CodeBuild to run unit tests on feature branches before merging.

Options B and D are correct. Option B: CodeBuild can run unit tests on feature branches before merging, ensuring code quality. Option D: Separate pipelines for develop and master branches allow different deployment behaviors (e.g., non-prod vs. prod). Option A is wrong because disabling automatic triggers on the master branch would prevent automated deployments when changes are merged, which is contrary to GitFlow where master deployments are desired. Option C is wrong because a single pipeline for all branches reduces flexibility and can cause unintended deployments. Option E is wrong because CodePipeline does not natively support pull request triggers; use CodeBuild or other services for that.

Answer analysis

Option-by-option breakdown

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

  • ✗

    Disable automatic triggers on the master branch to prevent accidental deployments.

    Why it's wrong here

    Disabling automatic triggers on master is incorrect for GitFlow because the master branch is precisely the integration point that should trigger a production deployment when a release branch is merged. Without automatic triggers, deployments become manual and error-prone, introducing a risk of drift between the tested commit and what is actually deployed. The expected behavior is that master merges automatically trigger the deployment pipeline.

  • ✓

    Use CodeBuild to run unit tests on feature branches before merging.

    Why this is correct

    Using CodeBuild to run unit tests on feature branches is correct because it provides fast, isolated feedback on each commit before the code is merged into develop. CodeBuild can be configured to respond to branch push or pull request webhooks, allowing tests to run without requiring a full CodePipeline execution. This validates code early in the development cycle, reducing the chance of integration problems and aligning with GitFlow's feature branch workflow.

  • ✗

    Use a single pipeline that handles all branches.

    Why it's wrong here

    Using a single pipeline for all branches is not aligned with GitFlow because it couples the deployment logic for different branches, making it difficult to apply distinct deployment strategies. For example, develop typically deploys to a lower environment with fewer approvals, while master requires stricter gates and production deployment steps. A single pipeline would force you to embed complex conditional logic to handle these differing requirements, reducing clarity and increasing the risk of accidental production deployments.

  • ✓

    Create separate pipelines for develop and master branches.

    Why this is correct

    Creating separate pipelines for develop and master is correct because it mirrors the GitFlow branching model where each branch has a distinct purpose and deployment target. The develop pipeline can deploy to a shared development or test environment with automated builds, while the master pipeline can handle production releases with approval gates and manual validation steps. Separating them allows you to tailor stages, IAM permissions, and notifications to each environment without cross-branch interference.

  • ✗

    Configure CodePipeline to trigger on pull request creation.

    Why it's wrong here

    Configuring CodePipeline to trigger on pull request creation is not supported because CodePipeline's webhooks only respond to push events, not pull request lifecycle events such as creation or update. To run tests in response to pull requests, you should configure AWS CodeBuild directly with a pull request webhook, or use a third-party source like GitHub with a custom event handler. Thus, this option is incorrect as stated because CodePipeline lacks native pull request triggers.

About these practice questions

One of 1,298 original DOP-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 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.