DOP-C02 SDLC Automation Practice Question
A development team is using AWS CodeCommit to store source code and AWS CodePipeline to automate builds and deployments. The team wants to ensure that builds and tests are triggered only when code is pushed to specific branches, and that manual approval is required before deploying to production. Which CodePipeline configuration should the team implement?
⚠ Common exam trap
Many exam-takers confuse where branch filters can be applied (source action only) and where manual approval should be placed (before the production deploy stage, not before build), leading them to select options that filter incorrectly or place approval at the wrong stage.
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 source action with a branch filter for main, and add a manual approval step before the production deployment stage.
CodePipeline source actions support branch filters that restrict which Git branches trigger the pipeline. By filtering on 'main', only pushes to that branch initiate the pipeline. Adding a manual approval step before the production deployment stage ensures that no code reaches production without explicit human sign-off, meeting both requirements precisely.
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 the source action to trigger on all branches and add a manual approval step before the build stage.
Why it's wrong here
Triggering on all branches means any push to feature, develop, or release branches initiates the pipeline, causing unnecessary builds and resource consumption, and more critically, those non-main branch artifacts could flow toward production if later stages are not gated. Placing the manual approval before the build stage is ineffective for protecting the production environment because every build still triggers; the approval should gate the promotion of artifacts from main into the production deploy stage. This configuration fails to isolate production releases to only main-branch commits and introduces manual overhead on every build rather than only on production promotions.
- ✗
Configure the source action with a branch filter for main, and add a manual approval step before the build stage.
Why it's wrong here
While restricting the source to main correctly limits pipeline executions to main pushes, adding the manual approval before the build stage forces a human to approve every build, including non-production builds like those for development or staging environments. The build stage is not production-specific; approval is needed to block the actual deployment to production, which occurs after build and likely after tests/artifacts are generated. This would slow down CI/CD unnecessarily and fails to guard the production deployment itself.
- ✗
Use a branch filter on the build action to run only for the main branch, and add a manual approval step before the deploy stage.
Why it's wrong here
In AWS CodePipeline, branch filtering is a property of the source action, not the build action; the build action simply consumes the artifact from the source, so it has no branch filter configuration available. Even if the build could be filtered, placing approval before the generic 'deploy' stage may still allow deployment to non-production environments without approval, and does not explicitly restrict the source to main—so a push to another branch could still trigger a build if a source filter were misconfigured or absent. The correct pattern is to filter the source event and place the approval immediately before the production stage.
- ✓
Configure the source action with a branch filter for main, and add a manual approval step before the production deployment stage.
Why this is correct
The source action's branch filter ensures the pipeline only starts when commits are pushed to main, preventing feature branch work from entering the pipeline. The manual approval step immediately preceding the production deployment stage provides a human gate before the final artifact is deployed, meeting the requirement to require approval for production releases while keeping lower environments automated. This arrangement minimizes unnecessary builds and accurately enforces change management only where needed.
Go deeper
Related to this question
About these practice questions
One of 251 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 →
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.