DVA-C02 Development with AWS Services Practice Question
A developer is creating an AWS Lambda function that processes files uploaded to an S3 bucket. The developer wants to invoke the Lambda function automatically when a new file is uploaded. Which approach should the developer use?
⚠ Common exam trap
The trap here is that candidates may overcomplicate the solution by choosing an indirect pattern like SQS or CloudWatch Events, not realizing that S3 has a built-in, direct integration with Lambda for event notifications.
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 S3 event notifications to invoke the Lambda function directly.
S3 can directly invoke a Lambda function via S3 event notifications. When a new object is created in the bucket, S3 publishes a notification with the event type `s3:ObjectCreated:*` and the Lambda function is triggered asynchronously. This is the simplest and most direct integration for this use case, requiring no intermediate services.
Answer analysis
Option-by-option breakdown
For each option: why learners choose it and why it is or isn't the right answer here.
- ✗
Use Amazon API Gateway to expose an endpoint and have S3 call it.
Why it's wrong here
Using Amazon API Gateway to expose an endpoint and having S3 call it is not a direct or supported method for S3 event notifications. S3's native event notification system is designed to publish events directly to specific AWS services like Lambda, SQS, or SNS, not to arbitrary HTTP endpoints exposed by API Gateway. Attempting this would require an intermediary service to translate S3 events into API Gateway calls, adding unnecessary complexity and an unsupported integration pattern.
- ✗
Configure S3 to send events to an SQS queue, and configure Lambda to poll the queue.
Why it's wrong here
Configuring S3 to send events to an SQS queue and then having Lambda poll the queue is a valid and robust pattern, but it introduces an additional service and complexity that is not strictly necessary for simply invoking a Lambda function. While SQS provides benefits like message buffering, retries, and dead-letter queue capabilities, for a straightforward requirement of processing S3 object events, directly invoking Lambda from S3 is the simpler and more efficient approach.
- ✓
Configure S3 event notifications to invoke the Lambda function directly.
Why this is correct
Configuring S3 event notifications to invoke the Lambda function directly is the most straightforward and recommended approach for processing S3 object events. S3's native event notification feature allows a bucket to publish events, such as `s3:ObjectCreated:Put`, directly to an AWS Lambda function. This establishes a direct, asynchronous invocation model where S3 acts as the event source, pushing events to Lambda without requiring any intermediary services.
- ✗
Use Amazon CloudWatch Events to trigger Lambda on S3 PUT events.
Why it's wrong here
Using Amazon CloudWatch Events (now Amazon EventBridge) to trigger Lambda on S3 PUT events is an indirect and less efficient method compared to S3's native event notifications. While CloudWatch Events can react to AWS API calls captured by CloudTrail, including S3 `PutObject` events, it introduces additional latency and configuration overhead. S3's built-in event notification system is purpose-built for reacting to object-level operations directly within the S3 service, offering a more direct and optimized integration.
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 1,135 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.