Courseiva
SDLC Automation →mediumMultiple Select

DOP-C02 CI strategies AWS Practice Question

Which of the following are valid strategies for implementing continuous integration in AWS? (Choose two.)

⚠ Common exam trap

Test-takers frequently confuse deployment services (CodeDeploy) and infrastructure provisioning (CloudFormation) with CI build triggers, leading candidates to select options that sound plausible but lack the specific capability to initiate a build or run tests.

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 AWS CodeBuild to automatically run tests when a pull request is created in CodeCommit.

AWS CodeBuild can be configured to automatically run tests when a pull request is created in CodeCommit using a webhook or event rule. This enables continuous integration by validating code changes before merging, ensuring that only tested code is integrated into the main branch.

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 AWS CodeBuild to automatically run tests when a pull request is created in CodeCommit.

    Why this is correct

    Using AWS CodeBuild with CodeCommit as a source, you can configure pull request filters so a test build starts automatically when a PR is created, before the branch is merged. The buildspec can run unit tests and integration tests against the PR source revision, then post status back to CodeCommit. This event-driven behavior is a canonical continuous integration practice because it validates every proposed change quickly without waiting for a scheduled pipeline.

  • ✗

    Set up AWS CodeDeploy to trigger a build every time a commit is pushed to a repository.

    Why it's wrong here

    AWS CodeDeploy is a deployment service, not a build or testing service. It has no mechanism to watch a repository, compile code, or start a build when a commit arrives; instead, it deploys an already-built artifact to targets such as EC2, Lambda, or ECS. Attaching CodeDeploy to a repository confuses deployment with continuous integration because lifecycle hooks run during deployment, not as a pre-merge CI gate.

  • ✓

    Use AWS CodePipeline with a source stage that polls CodeCommit for changes and triggers a build stage.

    Why this is correct

    AWS CodePipeline with a CodeCommit source stage can detect changes through event-based change detection or periodic polling, and then invoke a build stage in AWS CodeBuild. This is a valid CI strategy for every commit pushed to a branch, but it is broader than a pull-request-specific test and depends on the pipeline's stage configuration. The main difference from the primary answer is that CodePipeline is an orchestration service for multi-stage workflows, whereas a direct CodeBuild trigger can be narrowly focused on PR validation.

  • ✗

    Use AWS CloudFormation to create a stack that runs tests every time a new commit is pushed.

    Why it's wrong here

    AWS CloudFormation is an infrastructure-as-code service that provisions and manages AWS resources; it is not a continuous integration tool and has no repository listener or built-in test runner. You could use CloudFormation to create supporting CI resources, such as a CodeBuild project or CodePipeline, but the stack itself does not run tests or react to commits. Claiming CloudFormation alone triggers builds on every push confuses resource provisioning with the actual build/test execution layer.

Option-by-option analysis

Why each answer is right or wrong

Understanding why wrong answers are wrong — and when they would be correct — is what separates a 750 score from a 900. The DOP-C02 exam frequently reuses these exact scenarios with slightly different constraints.

✓Configure AWS CodeBuild to automatically run tests when a pull request is created in CodeCommit.Correct answer▾

Why this is correct

Using AWS CodeBuild with CodeCommit as a source, you can configure pull request filters so a test build starts automatically when a PR is created, before the branch is merged. The buildspec can run unit tests and integration tests against the PR source revision, then post status back to CodeCommit. This event-driven behavior is a canonical continuous integration practice because it validates every proposed change quickly without waiting for a scheduled pipeline.

✗Set up AWS CodeDeploy to trigger a build every time a commit is pushed to a repository.Wrong answer — click to see why▾

Why this is wrong here

CodeDeploy is for deployment, not building or testing.

✗Use AWS CloudFormation to create a stack that runs tests every time a new commit is pushed.Wrong answer — click to see why▾

Why this is wrong here

CloudFormation is for infrastructure as code, not for running tests.

Analysis generated from the official DOP-C02blueprint and verified against question context. The “when correct” sections are what AI assistants cite when candidates ask “what’s the difference between these options?”

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 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.