Course menuDOP-C02

Exams / DOP-C02 / CodePipeline structure, stages and triggers / Question 1

DOP-C02 practice question: CodePipeline structure, stages and triggers

SDLC Automation A free question from our original DOP-C02 practice exam. Try it, then open the answer to see why each option is right or wrong.

Last verified against current AWS documentation ·How we write our questions

A logistics company deploys its route-planning service to Amazon ECS from an AWS CodePipeline pipeline. The source is a GitHub monorepo connected through AWS CodeConnections, and the service lives under a services/routing folder beside web frontends and documentation.

Today the pipeline starts on every push to every branch, so feature-branch commits reach the production approval stage and documentation-only commits trigger full deployments. Release managers want a run to start only for pushes to the main branch that change files under services/routing.

The team also wants no custom code to host, patch or debug, and the existing pipeline to remain the single place where production deployments are approved.

Which change meets these requirements with the LEAST operational overhead?

Choose one answer.

  1. A. Add an Amazon API Gateway endpoint and a Lambda function that receives every GitHub webhook, reads the changed file paths, and calls StartPipelineExecution only for matching pushes to main.
  2. B. Convert the pipeline to a V2 pipeline, and set a push trigger on the CodeConnections source action with branch filters for main and file path filters for services/routing/**.
  3. C. Keep the V1 pipeline and add a first CodeBuild stage that diffs the commit and fails when no routing files changed, so the run stops before any deployment starts.
  4. D. Keep the V1 pipeline unchanged, and have a release engineer review each push to main and start the pipeline by hand from the console when the routing folder has changed.
Show the answer and explanation

Answer: B

Explanation

A V2 pipeline can filter Git pushes by branch and by changed file path, and a CodeConnections source action delivers those events without extra infrastructure. A webhook function, a diff stage or a manual start each adds code or steps the team must run, and the diff stage still records a run for every unrelated commit.

Study

Keep practicing

Answer questions with a score at the end, or practice just this topic with the explanation after each one. No sign-up needed.

Want more on CodePipeline structure, stages and triggers? The 5 full-length practice sets have 8 more CodePipeline structure, stages and triggers questions, 375 in all, none of them in the free exam. One payment of $14.99, no subscription. See the practice sets