Courseiva
Development with AWS ServiceseasyMultiple ChoiceObjective-mapped

DVA-C02 Development with AWS Services Practice Question

A developer is writing an AWS Lambda function that processes files uploaded to an S3 bucket. The function should only be triggered when a new object is created in a specific subfolder (e.g., /uploads/). Which S3 event notification configuration should the developer use?

⚠ Common exam trap

The trap here is that candidates might think filtering inside the Lambda function is acceptable (Option B), but AWS best practice and the exam emphasize configuring filtering at the event source to minimize invocations and follow the principle of least privilege for triggers.

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 the event notification with a prefix filter set to 'uploads/' and event type 's3:ObjectCreated:*'.

S3 event notifications support prefix filtering, which allows you to specify a key prefix (e.g., 'uploads/') so that only object creation events in that subfolder trigger the Lambda function. By setting the event type to 's3:ObjectCreated:*', the function responds to all object creation operations (PUT, POST, Copy, etc.) within the filtered path, meeting the requirement precisely without unnecessary invocations.

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 event notification with a prefix filter set to 'uploads/' and event type 's3:ObjectCreated:*'.

    Why this is correct

    This approach leverages Amazon S3's native event notification capabilities to precisely target specific object creation events. By setting a prefix filter to 'uploads/', the S3 bucket will only send notifications to the Lambda function when an object is created within that specific virtual folder. Combining this with the `s3:ObjectCreated:*` event type ensures that the Lambda function is invoked solely for new object uploads in the designated path, optimizing resource utilization and minimizing unnecessary Lambda invocations and associated costs.

  • Configure a single event notification for all objects and filter on the prefix inside the Lambda function.

    Why it's wrong here

    While technically feasible to filter within the Lambda function, configuring a broad event notification for all S3 object creations is inefficient and costly. Every object creation, regardless of its prefix, would trigger a Lambda invocation, leading to unnecessary cold starts and execution time for events that do not meet the desired criteria. This significantly increases operational costs due to excess Lambda invocations and data transfer, and adds latency as the function must execute before discarding irrelevant events.

  • Configure the event notification using object tags to filter events.

    Why it's wrong here

    Amazon S3 event notifications currently do not support filtering based on object tags. The available filtering options are limited to object key prefixes and suffixes, which allow for targeting objects based on their naming conventions or virtual folder structure. To filter by object tags, one would typically need to invoke the Lambda for all relevant object creation events and then perform the tag-based filtering logic within the Lambda function itself, which is less efficient than native S3 filtering.

  • Use AWS CloudTrail to detect S3 PutObject events and trigger Lambda.

    Why it's wrong here

    AWS CloudTrail is primarily an auditing and logging service that records API calls made to AWS services, including S3 `PutObject` events. While it captures these events, CloudTrail is not designed for real-time, event-driven invocation of Lambda functions. There is inherent latency in CloudTrail log delivery, making it unsuitable for immediate processing requirements, and it would require additional services like CloudWatch Events or EventBridge to process CloudTrail logs and trigger Lambda, adding complexity and delay.

Quick reference

AWS S3 Storage Class Comparison

Storage ClassMin DurationRetrievalUse Case
S3 StandardNoneImmediateFrequently accessed data
S3 Standard-IA30 daysImmediateInfrequent access, rapid retrieval
S3 One Zone-IA30 daysImmediateNon-critical infrequent data
S3 Intelligent-TieringNoneImmediate–hoursUnknown or changing access patterns
S3 Glacier Instant90 daysMillisecondsArchive with instant retrieval
S3 Glacier Flexible90 daysMinutes–hoursArchive, flexible retrieval
S3 Glacier Deep Archive180 daysHoursLong-term compliance archive

About these practice questions

Courseiva writes every DVA-C02 question from scratch — 724 in total, each with an explanation and a wrong-answer breakdown. None are copied from real exams or dumps. Learn why practice questions differ from exam dumps →

How Courseiva writes practice questions · Editorial policy

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.