How to trigger AWS CodePipeline on source code changes?

DVA-C02 By islever Editorial Last updated

Short answer

AC Store the source code in an Amazon S3 bucket. Configure AWS CodePipeline to start whenever a file in the bucket changes. Store the source code in an AWS CodeCommit repository. Configure AWS CodePipeline to start whenever a change is committed to the repository.

Question

A development team wants to immediately build and deploy an application whenever there is a change to the source code. Which approaches could be used to trigger the deployment? (Choose two.)
  1. Store the source code in an Amazon S3 bucket. Configure AWS CodePipeline to start whenever a file in the bucket changes. Correct Answer
  2. Store the source code in an encrypted Amazon EBS volume. Configure AWS CodePipeline to start whenever a file in the volume changes.
  3. Store the source code in an AWS CodeCommit repository. Configure AWS CodePipeline to start whenever a change is committed to the repository. Correct Answer
  4. Store the source code in an Amazon S3 bucket. Configure AWS CodePipeline to start every 15 minutes.
  5. Store the source code in an Amazon EC2 instance’s ephemeral storage. Configure the instance to start AWS CodePipeline whenever there are changes to the source code.

Key Takeaways

This question tests valid CodePipeline source providers and the distinction between event-based triggers and polling schedules, ensuring the deployment is immediate rather than delayed.

To achieve immediate deployment upon code changes, AWS CodePipeline can be configured to detect changes in Amazon S3 buckets or AWS CodeCommit repositories. The community confirms these are the only valid, event-driven approaches listed in the options.

Common mistake: Selecting Option D is a common mistake because while S3 is a valid source, the 15-minute polling interval violates the requirement for immediate deployment.

Expert Analysis

Why the Answer Is Correct

Options A and C are correct because Amazon S3 and AWS CodeCommit are supported source providers for AWS CodePipeline that allow for event-based change detection. When a file is uploaded to an S3 bucket or a commit is pushed to a CodeCommit repository, the pipeline can be triggered immediately via CloudWatch Events/EventBridge.

Why the Other Options Are Wrong

Option B is incorrect because Amazon EBS volumes are block storage attached to EC2 instances and are not valid source providers for CodePipeline. Option D is incorrect because polling every 15 minutes does not meet the requirement for immediate deployment. Option E is incorrect because EC2 instance store (ephemeral storage) is not a supported integration source for triggering pipelines automatically in this context.

Community Comment Notes

Community members unanimously agreed on answers A and C, noting that only these options present valid repository types for CodePipeline. One useful comment highlighted that Option D is invalid specifically because it relies on a schedule rather than an automatic trigger.

Official Reference

https://docs.aws.amazon.com/codepipeline/latest/userguide/reference-pipeline-structure.html

This link opens the official vendor documentation in a new tab.

Exam Strategy

Look for keywords like 'immediate' to identify event-driven triggers over polling mechanisms. Memorize the supported source providers for CodePipeline (S3, CodeCommit, GitHub, Bitbucket) to quickly eliminate invalid storage options like EBS.

Community Votes

AC
100%

100% of anonymous learners picked answer AC. Votes are pick records left by other test-takers — they are not the verified answer.

Discussion 3 contributions

Compiled from public community threads and reader submissions, lightly edited for clarity. Handles and vote tallies are shown as recorded, and comments reflect the views of individual contributors.

From public community threads 3

  1. wh1t4k3r 👍 1
    https://docs.aws.amazon.com/codepipeline/latest/userguide/reference-pipeline-structure.html#:~:text=When%20you%20create%20a%20pipeline,commit%20a%20source%20code%20change. Only A and C present valid repository types for codepipeline. D also does, but it is not automatic.
  2. tullio85 👍 1
    both A and C are correct
  3. Saudis 👍 1
    Answer is AC

Reader comments & corrections

No reader corrections yet — spotted an error or have a note? Share it below.

Log in to comment, report an error, or add a note about this question.

Practice All DVA-C02 Questions

Access 100 questions with complete answers and detailed explanations.

View Full DVA-C02 Practice Test →

← Back to DVA-C02 Study Guide