DVA-C02 practice question 13 of 35

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?

Full set: 598 questions

Domain Troubleshooting and Optimization

Answer options
A: Create an Amazon Simple Notification Service (Amazon SNS) topic Configure S3 event notifications with a destination of the SNS topic Subscribe the Lambda function to the SNS topic Create an email notification subscription to the SNS topic Correct answer
B: Create an Amazon Simple Notification Service (Amazon SNS) topic. Configure S3 event notifications with a destination of the SNS topic. Subscribe the Lambda function to the SNS topic. Create an Amazon Simple Queue Service (Amazon SQS) queue Subscribe the SQS queue to the SNS topic Create an email notification subscription to the SQS queue.
C: Create an Amazon Simple Queue Service (Amazon SQS) queue Configure S3 event notifications with a destination of the SQS queue Subscribe the Lambda function to the SQS queue Create an email notification subscription to the SQS queue.
D: Create an Amazon Simple Queue Service (Amazon SQS) queue. Send S3 event notifications to Amazon EventBridge. Create an EventBndge rule that runs the Lambda function when images are uploaded to the S3 bucket Create an EventBridge rule that sends notifications to the SQS queue Create an email notification subscription to the SQS queue
Correct Answer:
A. Create an Amazon Simple Notification Service (Amazon SNS) topic Configure S3 event notifications with a destination of the SNS topic Subscribe the Lambda function to the SNS topic Create an email notification subscription to the SNS topic
Explanation

This scenario requires a "fan-out" pattern, where a single event (an S3 object creation) triggers multiple, independent actions (Lambda invocation and email notification). Amazon Simple Notification Service (SNS) is designed specifically for this pub/sub, fan-out messaging model. By configuring S3 event notifications to publish to an SNS topic, the event is sent to a central point. The Lambda function can subscribe to this topic to process the image, and an email endpoint can also be subscribed to the same topic to send the notification. This architecture is efficient, decoupled, and directly addresses both requirements using the most appropriate services.

Why Incorrect

B: This option is overly complex. There is no native capability to create an email subscription directly to an SQS queue. The SQS queue adds an unnecessary and non-functional step for the email notification. C: Amazon SQS is a queueing service, not a fan-out service. A message sent to an SQS queue is typically processed by only one consumer. Also, SQS does not support direct email subscriptions. D: While EventBridge can handle fan-out, this solution incorrectly routes the notification to an SQS queue. SQS does not support direct email subscriptions, making the final step of the notification workflow invalid.

References

1. AWS S3 Developer Guide: "Configuring Amazon S3 event notifications" - This document lists Amazon SNS topics, Amazon SQS queues, and AWS Lambda functions as supported destinations for S3 event notifications. This validates the initial step of the correct architecture. (See section: "Event notification destinations").

2. AWS SNS Developer Guide: "Common Amazon SNS scenarios" - The "Fanout" scenario is explicitly described: "a message published to an SNS topic can be replicated and pushed to multiple endpoints... For example, you can... send a message to an Amazon SQS queue, which then sends the message to a Lambda function." This confirms SNS is the correct service for fan-out to multiple subscriber types. (See section: "Fanout").

3. AWS SNS Developer Guide: "Subscribing to an Amazon SNS topic" - This page lists the available protocols for subscriptions, which include AWS Lambda and Email/Email-JSON. This confirms that both required actions can be subscribed to a single SNS topic. (See table: "Subscription and delivery protocols").

4. AWS Lambda Developer Guide: "Using AWS Lambda with Amazon SNS" - This guide details how to use an SNS topic to trigger a Lambda function, which is a core part of the required solution. (See section: "Invoking Lambda functions using Amazon SNS notifications").

Scroll to Top