AWS Certified Developer – Associate (DVA-C02) — Question 533
A company has an application that processes audio files for different departments. When audio files are saved to an Amazon S3 bucket, an AWS Lambda function receives an event notification and processes the audio input.
A developer needs to update the solution so that the application can process the audio files for each department independently. The application must publish the audio file location for each department to each department's existing Amazon Simple Queue Service (Amazon SQS) queue.
Which solution will meet these requirements with no changes to the Lambda function code?
Answer options
- A. Configure the S3 bucket to send the event notifications to an Amazon Simple Notification Service (Amazon SNS) topic. Subscribe each department’s SQS queue to the SNS topic. Configure subscription filter policies.
- B. Update the Lambda function to write the file location to a single shared SQS queue. Configure the shared SQS queue to send the file reference to each department’s SQS queue.
- C. Update the Lambda function to send the file location to each department’s SQS queue.
- D. Configure the S3 bucket to send the event notifications to each department’s SQS queue.
Correct answer: A
Explanation
Option A is correct because utilizing an Amazon SNS topic with subscription filter policies allows for a fan-out message routing pattern to multiple Amazon SQS queues without needing any code changes in the AWS Lambda function. Options B and C are incorrect because they require modifying the Lambda function code, which violates the requirements. Option D is incorrect because Amazon S3 event notifications cannot natively filter and route events to multiple SQS queues based on custom department attributes.