DVA-C02 Development with AWS Services Practice Question
A developer is building a CI/CD pipeline using AWS CodePipeline. The source stage is an Amazon S3 bucket. The developer wants to automatically start the pipeline when a new file is uploaded to the S3 bucket. What should the developer do?
⚠ Common exam trap
A common mix-up: candidates confuse SNS or SQS as valid CodePipeline triggers, but AWS CodePipeline only supports CloudWatch Events/EventBridge, webhooks (for GitHub), and manual or scheduled triggers—not direct SNS subscriptions or SQS polling.
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
✓
Create an Amazon CloudWatch Events rule that triggers on S3 object creation events and targets the pipeline.
Amazon CloudWatch Events (now Amazon EventBridge) can directly target an AWS CodePipeline pipeline as a rule target. By creating a rule that matches S3 object creation events (e.g., `s3:ObjectCreated:*`), the pipeline is automatically triggered without any intermediate polling, custom code, or additional services. This is the native, serverless integration recommended by AWS.
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 S3 bucket to send events to an SQS queue, and poll the queue from CodePipeline.
Why it's wrong here
While Amazon S3 can publish object creation events to an Amazon SQS queue, AWS CodePipeline does not natively support polling an SQS queue as a direct source stage trigger. CodePipeline's source actions are designed to integrate with specific AWS services like S3 or CodeCommit, often relying on event-driven mechanisms rather than polling arbitrary queues. Therefore, this approach would not automatically initiate the pipeline upon new S3 object creation.
- ✓
Create an Amazon CloudWatch Events rule that triggers on S3 object creation events and targets the pipeline.
Why this is correct
This is the correct and recommended approach. Amazon S3 can publish object creation events directly to Amazon EventBridge (formerly CloudWatch Events). An EventBridge rule can then be configured to filter these specific S3 events and directly invoke an AWS CodePipeline as its target. This establishes an efficient, event-driven mechanism to automatically start the CI/CD pipeline whenever new source artifacts are uploaded to the designated S3 bucket.
- ✗
Set up a periodic Lambda function that checks the S3 bucket for new files and starts the pipeline.
Why it's wrong here
Implementing a periodic AWS Lambda function to poll an S3 bucket for new files is an inefficient and suboptimal solution for triggering a CI/CD pipeline. This approach introduces unnecessary latency between object creation and pipeline initiation, consumes compute resources even when no new files are present, and adds operational overhead for managing the Lambda schedule and permissions. Event-driven architectures, like using EventBridge, are significantly preferred for their immediate response and cost-effectiveness.
- ✗
Configure the S3 bucket to send events to an SNS topic, and subscribe CodePipeline to the topic.
Why it's wrong here
Although S3 can publish events to an Amazon SNS topic, AWS CodePipeline does not support subscribing to an SNS topic directly as a mechanism to trigger a pipeline execution. SNS is primarily designed for message fan-out to various subscribers like email, SMS, or other services, but it lacks the direct integration capability to initiate CodePipeline workflows. EventBridge is the designated service for orchestrating such event-driven pipeline starts.
Quick reference
AWS S3 Storage Class Comparison
| Storage Class | Min Duration | Retrieval | Use Case |
|---|---|---|---|
| S3 Standard | None | Immediate | Frequently accessed data |
| S3 Standard-IA | 30 days | Immediate | Infrequent access, rapid retrieval |
| S3 One Zone-IA | 30 days | Immediate | Non-critical infrequent data |
| S3 Intelligent-Tiering | None | Immediate–hours | Unknown or changing access patterns |
| S3 Glacier Instant | 90 days | Milliseconds | Archive with instant retrieval |
| S3 Glacier Flexible | 90 days | Minutes–hours | Archive, flexible retrieval |
| S3 Glacier Deep Archive | 180 days | Hours | Long-term compliance archive |
Go deeper
Related to this question
About these practice questions
One of 724 original DVA-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 DVA-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 DVA-C02 exam.