DVA-C02 · Question #111
A developer is creating a service that uses an Amazon S3 bucket for image uploads. The service will use an AWS Lambda function to create a thumbnail of each image. Each time an image is uploaded, the
The correct answer is A. Create an Amazon Simple Notification Service (Amazon SNS) topic. Configure S3 event. An SNS topic configured as the S3 event destination enables a fan-out pattern where a single S3 upload triggers both a Lambda function (thumbnail creation) and an email subscription simultaneously.
Question
A developer is creating a service that uses an Amazon S3 bucket for image uploads. The service will use an AWS Lambda function to create a thumbnail of each image. Each time an image is uploaded, the service needs to send an email notification and create the thumbnail. The developer needs to configure the image processing and email notifications setup. Which solution will meet these requirements?
Options
- ACreate an Amazon Simple Notification Service (Amazon SNS) topic. Configure S3 event
- BCreate an Amazon Simple Notification Service (Amazon SNS) topic. Configure S3 event
- CCreate an Amazon Simple Queue Service (Amazon SQS) queue. Configure S3 event
- DCreate an Amazon Simple Queue Service (Amazon SQS) queue. Send S3 event notifications to
How the community answered
(58 responses)- A76% (44)
- B3% (2)
- C7% (4)
- D14% (8)
Why each option
An SNS topic configured as the S3 event destination enables a fan-out pattern where a single S3 upload triggers both a Lambda function (thumbnail creation) and an email subscription simultaneously.
By configuring the S3 bucket to publish object-created events to an SNS topic, and then subscribing both a Lambda function and an email endpoint (via SNS email subscription) to that topic, a single upload event fans out to both processing paths concurrently. This is the standard AWS fan-out pattern using SNS, requiring no polling and no additional coordination code.
The answer choices B and C/D involving SQS would serialize processing or require polling, and a single SQS queue cannot natively deliver the same message to both Lambda and an email endpoint simultaneously.
SQS is a point-to-point queue; a single message can only be consumed once by one consumer, making it unsuitable for delivering the same event to multiple independent processors without additional fan-out infrastructure.
Sending S3 events directly to SQS and then to a second service adds unnecessary complexity and does not natively support email delivery without additional services.
Concept tested: SNS fan-out pattern for multi-consumer S3 event processing
Source: https://docs.aws.amazon.com/sns/latest/dg/sns-common-scenarios.html
Community Discussion
No community discussion yet for this question.