An event-driven system has one Lambda function that processes data and must send the processed data to a subset of four consumer Lambda functions. Routing is based on the value of one field in the data. Which solution provides the required routing with the least operational overhead?
Choose an answer
Tap an option to check your answer.
Correct answer: Create a single Amazon SNS topic, subscribe the four consumer Lambda functions to that topic, configure SNS subscription filter policies for each subscription, and have the data-processing Lambda publish to the topic..
Why this is the answer
The correct solution leverages Amazon SNS topic filtering, which is designed for this exact scenario. By creating a single SNS topic, subscribing all consumer Lambda functions, and then applying subscription filter policies, you can route messages based on message attributes (like the field value in the data) without writing routing logic in the producer Lambda. The producer Lambda simply publishes to the topic, and SNS handles the conditional delivery, minimizing operational overhead and code complexity. Incorrect options: Creating SQS queues with event source mappings for each consumer and adding routing logic to the producer Lambda increases the producer's complexity and operational overhead. Subscribing all consumers to an SNS topic and adding filtering logic inside each consumer Lambda means every consumer receives all messages, increasing unnecessary invocations and processing. Creating a separate SNS topic for each consumer, while functional, adds significant operational overhead by requiring the management of multiple topics and more complex publishing logic in the producer.
Pass your exam — without the endless answer hunt
Get every verified question and explanation for this exam in one place, and save hours of prep. 1,000+ certifications · 20+ languages · free to start.
Pass your exam faster → No card needed