API Gateway Fanout to Multiple Lambda Functions with Filtering?
Short answer
B Send API Gateway requests to Amazon EventBridge, whose rules filter events and invoke the target Lambda functions directly with the least operational overhead.
Question
Key Takeaways
Tests the difference between SNS fanout (which needs SQS queues and Lambda polling for filtering) and EventBridge rule-to-Lambda invocation; the trap is assuming SNS filter policies make option A the least overhead.
The question asks for the least-overhead way to route API Gateway messages to multiple Lambda functions while filtering what each function receives. Amazon EventBridge meets this by applying rule-based event patterns and invoking Lambda targets directly.
Common mistake: Picking SNS with SQS queues (A) because SNS supports message filtering and fanout, but the added queues and polling mean more operational overhead than EventBridge rules.
Expert Analysis
Why the Answer Is Correct
Amazon API Gateway REST APIs can invoke EventBridge as an AWS service integration, and EventBridge rules support event-pattern filtering before invoking targets. Those targets can be Lambda functions directly, so each function receives only messages matching its rule without any polling infrastructure. This direct rule-to-Lambda invocation is what makes B the least-operational-overhead answer. Commenters like BillaRanga and 1166ae3 capture the core trade-off: "LEAST operational overhead -> B better than A" and "SNS has to use SQS to send filtered content, and Lambda has to poll the SQS". Although a single EventBridge rule supports up to five targets, LeonSauveterre notes you can "work around it by creating additional rules," which still leaves fewer moving parts than SNS+SQS.
Why the Other Options Are Wrong
Option A works functionally: SNS supports subscription filter policies and can fan out to SQS queues, but each Lambda then polls its queue, adding SQS queues, visibility-timeout tuning, dead-letter queues, and polling configuration. Option D sends to multiple SQS queues directly, but there is no server-side message filtering service and each function still polls, so it fails the filtering and least-overhead test. Option C uses Amazon MSK, a provisioned Kafka cluster requiring broker management, scaling, and monitoring; it is neither serverless nor low-overhead. BBR01 correctly flags that "you can only define up to five targets for each rule," but that is a per-rule constraint, not a reason to choose A.
Community Comment Notes
AMEJack argues the EventBridge approach is easier than managing multiple SNS topics and SQS queues, and 03beafc counts services: "Eventbridge + lambda is two services, sns + sqs + lambda is 3." lenotc points out that "EventBridge rules can filter messages based on, content, attributes, or patterns," while BBR01 raises the target limit and LeonSauveterre explains the additional-rule workaround. JA2018 simply agrees that "based on the stem, B required the LEAST operational overhead." The dissenting votes for A (Scheldon, BBR01) focus on SNS as a messaging service, but they do not reduce the SQS polling overhead.
Official Reference
- https://aws.amazon.com/blogs/compute/capturing-client-events-using-amazon-api-gateway-and-amazon-eventbridge/
- https://docs.aws.amazon.com/eventbridge/latest/userguide/eb-targets.html
These links open the official vendor documentation in a new tab.
Exam Strategy
When LEAST operational overhead appears, count the managed services and integration steps each option requires. EventBridge invoking Lambda directly is one hop with filtering built into the rule, while SNS-to-SQS-to-Lambda adds queues, polling, and queue-level configuration.
Frequently Asked Questions
Why is SNS with SQS queues (option A) not the least-overhead solution?
Does EventBridge's five-targets-per-rule limit invalidate option B?
Community Votes
51% of anonymous learners picked answer B. Votes are pick records left by other test-takers — they are not the verified answer.
Discussion 23 contributions
Compiled from public community threads and reader submissions, lightly edited for clarity. Handles and vote tallies are shown as recorded, and comments reflect the views of individual contributors.
From public community threads 23
-
AMEJack 👍 5 Answered BThe question is asking about one service. If you choose A, you need to build 3 services one per each SNS topic. Also, creating one Event Bridge with rules to forward to the target Lambda is easier than creating 3 topics with 3 SQS queues. The answer is definetly B.
-
BillaRanga 👍 4 Answered Bto multiple target = SNS, EventBridge. Also, SNS has to use SQS to send filtered content, and Lambda has to poll the SQS to get the message, which is clearly an Overhead. Meanwhile, EventBridge can invoke a Lambda function, which reduces the Operational Overhead.
-
BBR01 👍 4 Answered AThe main issue with B is that with Eventbrige, you can only define up to five targets for each rule. https://docs.aws.amazon.com/eventbridge/latest/userguide/eb-targets.html
-
03beafc 👍 3 Answered BEventbridge + lambda is two services, sns + sqs + lambda is 3. Both can filter, but the config involved in eventbridge > lambda is easier
-
Scheldon 👍 3 Answered AAnswerA Hence EventBridge is a solution to handle events and we need to handle messages I believe option A is the best solution here
Show 18 more comments
-
lenotc 👍 3 Answered BEventBridge rules can filter messages based on, content, attributes, or patterns
-
LeonSauveterre 👍 2 Answered BEventBridge applies filtering rules and invokes the appropriate Lambda functions directly, just like SNS + SQS. Option B is definitely "the LEAST operational overhead". While there’s a 5-target-per-rule limit, you can work around it by creating additional rules. Each rule can directly invoke Lambda functions without the need for SQS queues or polling. Let's not stick to option A just because it's the textbook exam-standard SNS+SQS combination. There are other options that will help you achieve the goal under different circumstances.
-
sandordini 👍 2B: EventBridge reacts to events, not requests or messages. C: I don't think so, but I don't know MSK well enough. D: You can add a filter so that your function only processes Amazon SQS messages containing certain data parameters. but it will still receive, so I assume it's not what the question asks for. Only A remains... But it still misses steps plus we are looking for the Least ops overhead.. I am confused..
-
knben 👍 2I'd go with D Multiple targets but target Lambda functions the ability to receive only the messages the functions need, so gateway should send to specific SQS so specific lambda can process that message. With SNS you send to all at once, so lambdas will get the messages they can't process. Correct me if I'm wrong.
-
3bdf1cc 👍 2https://aws.amazon.com/blogs/compute/capturing-client-events-using-amazon-api-gateway-and-amazon-eventbridge/
-
TruthWS 👍 2Option B - Eventbridge allow routing event from source to dest or multi dest you want
-
JA2018 👍 2 Answered Bagreed with AMEJack.... based on the stem, B required the LEAST operational overhead
-
hgknight 👍 2 Answered Amultiple target, message filtering = SNS
-
jaswantn 👍 2option A.. SNS message filtering
-
Denise123 👍 1 Answered BThe answer is B. On the other hand, the solution involving Amazon SNS, Amazon SQS, and Lambda polling (Option A) introduces more moving parts and operational overhead: It requires managing and configuring multiple services (SNS, SQS, and Lambda). Lambda functions need to continuously poll SQS queues, which can be less efficient and introduce additional latency. Scaling and managing SQS queues and their associated resources (e.g., dead-letter queues) add operational complexity. While the SNS-SQS-Lambda solution is still valid and widely used, the EventBridge-Lambda integration offers a more streamlined and serverless-native approach, aligning better with the company's serverless architecture goals and minimizing operational overhead.
-
AlvinC2024 👍 1 Answered DUpload and store content in Amazon S3 in the Region that is closest to the user. Use multiple distributions of Amazon CloudFront. This approach ensures that uploads are quick, taking advantage of the geographical proximity of S3, while still leveraging CloudFront for efficient content delivery outside the local region if necessary. The local nature of the content consumption aligns with storing content in the closest region to the user, addressing the requirement that 90% of the content is consumed within the AWS Region where it is uploaded.
-
GOTJ 👍 1 Answered AI'm discarding option "B" for the following reasons 1. You can't send "requests" (messages) to EventBridge, at least not directly as option suggests. There must be an event involved in the process 2. Lack of configuration regarding to discrete Lambda invocations Option "A", by its side, also lacks of the necessary configuration for discrete lambda invocation (use of subscriptor filter), but in my opinion is closer to what company needs: https://docs.aws.amazon.com/sns/latest/dg/sns-message-filtering.html So my vote goes to "A".
-
Chen77 👍 1 Answered ASNS supports fan-out: API Gateway sends messages to an SNS topic, which then forwards to multiple SQS queues. Message filtering with SNS: SNS allows each SQS queue to receive only the relevant messages, reducing unnecessary processing. SQS queues decouple workloads: Lambda functions pull messages only when ready, ensuring efficient and scalable processing.
-
zdi561 👍 1 Answered BA and B both can do message filtering but A only filters message by attributes and B can do filtering by message content too, and B is simpler
-
hilker1983 👍 1 Answered BLEAST operational overhead -> B better than A
-
Kezuko 👍 14 Answered A"message filtering" = SNS
-
seetpt 👍 1 Answered AA because of SNS
-
Andy_09 👍 1Option A
Reader comments & corrections
No reader corrections yet — spotted an error or have a note? Share it below.
Related Analysis
Practice All SAA-C03 Questions
Access 120 questions with complete answers and detailed explanations.
View Full SAA-C03 Practice Test →