Q72 — AWS DVA-C02 Ch.3
Question 72 of 100 | ← Chapter 3
A developer is creating an AWS Lambda function triggered by messages from an Amazon Simple Notification Service (Amazon SNS) topic. Messages represent customer data updates from a Customer Relationship Management (CRM) system. The developer wants the Lambda function to process only messages related to email address changes. Other subscribers to the SNS topic will handle all other messages. Which solution meets these requirements with the least development effort?
- A. Use Lambda event filtering to allow only messages related to email address changes to invoke the Lambda function.
- B. Use an SNS filter policy on the Lambda function subscription to allow only messages related to email address changes to invoke the Lambda function. ✓
- C. Subscribe an Amazon Simple Queue Service (Amazon SQS) queue to the SNS topic. Configure an SQS queue filter policy to allow only messages related to email address changes. Connect the SQS queue to the Lambda function.
- D. Configure the Lambda code to inspect incoming messages. If a message is unrelated to email address changes, configure the Lambda function to republish the message back to the SNS topic for other subscribers to process.
Correct Answer: B. Use an SNS filter policy on the Lambda function subscription to allow only messages related to email address changes to invoke the Lambda function.
Explanation
Option B is correct because SNS filter policies allow you to directly specify message filtering criteria at the time of Lambda function subscription. Using an SNS filter policy, you can define filtering conditions in the subscription from the SNS topic to the Lambda function, ensuring the Lambda function processes only messages related to email address changes. This approach requires the least development effort and performs message filtering natively at the SNS layer, simplifying processing logic. 【Lantern Certification: swufelp1999】