A Lambda function subscribed to an SNS topic should process only messages that indicate email address changes; other subscribers will handle other message types. You want the solution that requires the least development work. Which approach should you use?
Choose an answer
Tap an option to check your answer.
Correct answer: Configure an SNS subscription filter policy on the Lambda subscription so only email-change messages are delivered to that Lambda..
Why this is the answer
Configuring an SNS subscription filter policy directly on the Lambda subscription is the most efficient and least development-intensive approach. This allows SNS to filter messages before they are delivered to the Lambda function, meaning the Lambda is only invoked for relevant messages. This reduces unnecessary Lambda invocations and simplifies the Lambda's code, as it doesn't need to implement filtering logic. Using Lambda event filtering is incorrect because Lambda event filtering for SNS is not a native feature; Lambda processes all messages delivered to it from SNS. Subscribing an SQS queue with a filter policy and then connecting it to Lambda adds unnecessary complexity and an additional service (SQS) when SNS can handle the filtering directly. Having the Lambda inspect and republish messages is inefficient, increases Lambda execution time and costs, and creates a complex message routing loop.
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