DOP-C02 Practice Question 71: CodePipeline v2 Trigger Filters
AWS Certified DevOps Engineer – Professional (DOP-C02) · Test 8 · question 1 of 10
A team's application repository lives on GitHub and is connected to a V2 type CodePipeline pipeline through a CodeStar connection. They want the pipeline to start only when a commit is pushed to the main branch under the services/api/ path, and separately whenever a Git tag matching v* is pushed, regardless of branch. They want to configure this with pipeline triggers and no extra Lambda or webhook code.
Which capability should they use?
Show answer and explanation
Answer:
V2 type pipelines support trigger filters natively for connection-backed Git providers such as GitHub. A push filter can combine branch includes with file path includes, which are ANDed together, so the first filter starts the pipeline only for commits on main that touch services/api/. A separate push filter can include Git tags, and multiple filter types within the same trigger are ORed, so either condition independently starts the pipeline. All of this is declared in the pipeline definition, with no custom compute.
Option A reimplements what trigger filters already provide, adding two state machines to maintain, secure, and pay for.
Option B moves backward: V1 pipelines poll or use a basic webhook with a single filter pattern, and V1 does not support the tag plus branch plus file path filter combinations that V2 trigger filters offer natively.
Option C misunderstands the source: with a GitHub connection, CodePipeline is driven by the provider's push and pull request events, not by S3 object uploads to the artifact bucket, which only ever holds pipeline-generated artifacts.
Reference: Automate starting pipelines using triggers and filtering