DOP-C02 Question 273
Single answerA company is building a serverless application to process and analyze images uploaded to an Amazon S3 bucket. When an image is uploaded, metadata about the image needs to be extracted using an AWS Lambda function and then sent to a reporting system via an Amazon Simple Notification Service (Amazon SNS) topic. Which design approach best ensures an event-driven, asynchronous processing workflow while minimizing complexity and operational overhead?
- A
Configure an S3 Event Notification to trigger the Lambda function. The Lambda function processes the metadata and publishes it to the SNS topic.
- B
Set up an Amazon EventBridge rule to monitor the S3 bucket and invoke the Lambda function. The Lambda function processes the metadata and publishes it to the SNS topic.
- C
Use an Amazon SQS queue to poll the S3 bucket for new objects. Configure the Lambda function to process messages from the SQS queue and publish the metadata to the SNS topic.
- D
Enable AWS Batch to process the images uploaded to the S3 bucket and send the metadata to the SNS topic.
Show answer and explanation
Correct answer: A
Explanation
S3 Event Notifications provide a native and efficient way to trigger downstream services such as AWS Lambda in response to object uploads. This approach is highly suitable for event-driven, asynchronous workflows, as it minimizes operational overhead and complexity. The Lambda function can then handle metadata extraction and publish it to the SNS topic for further processing or notifications, aligning perfectly with the requirements of the scenario.
- A. Correct.
This is the correct option. S3 Event Notifications natively support triggering a Lambda function when objects are uploaded to an S3 bucket. The Lambda function can then process the image metadata and publish it to the SNS topic, ensuring an event-driven, asynchronous workflow with minimal operational overhead.
- B. Incorrect.
While Amazon EventBridge can monitor S3 events, using EventBridge for this use case introduces unnecessary complexity. S3 Event Notifications are a simpler and more direct way to trigger the Lambda function for this scenario.
- C. Incorrect.
Amazon SQS is not designed to poll S3 buckets. Using SQS in this scenario would add unnecessary complexity and is not required since S3 Event Notifications provide a native way to trigger Lambda functions.
- D. Incorrect.
AWS Batch is not suitable for this use case. It is designed for batch processing jobs and is not necessary for real-time event-driven workflows triggered by S3 object uploads.