AWS Certified Solutions Architect – Professional — Question 984
A company is running an image-processing service in the AWS Cloud. Users upload images to an Amazon S3 bucket for processing. When an image is uploaded to the S3 bucket, several microservices that are based on AWS Lambda functions need to perform different processing tasks on the image. Each task's processing must start immediately after an image is uploaded.
Which solution will meet these requirements?
Answer options
- A. Configure each microservice to create an S3 event notification with its Lambda function as the destination.
- B. Configure AWS CloudTrail event logging for Amazon S3. Create an Amazon EventBridge (Amazon CloudWatch Events) rule with an event pattern that matches PutObject API calls through CloudTrail. Register each microservice's Lambda function as a target for the rule.
- C. Create an Amazon EventBridge (Amazon CloudWatch Events) rule with an event pattern for PutObject events in S3 event notifications. Configure each microservice to register an Amazon Simple Queue Service (Amazon SQS) queue as a target for the rule. Invoke the microservice's Lambda function from the SQS queue.
- D. Create an S3 event notification with an Amazon Simple Notification Service (Amazon SNS) topic as the destination. Create an SNS subscription for each microservice's Lambda function.
Correct answer: D
Explanation
Publishing S3 event notifications to an Amazon SNS topic enables a classic fan-out pattern, allowing multiple subscribed AWS Lambda functions to be triggered immediately and in parallel. Direct S3 event notifications cannot be sent to multiple individual Lambda functions due to overlapping prefix and suffix configuration constraints. Using CloudTrail with EventBridge introduces latency that prevents immediate processing, and SQS queues are unnecessary for this real-time execution requirement.