Which solution will meet these requirements with the LEAST development effort?
Create an event source mapping between DynamoDB Streams and an AWS Lambda function. Use Lambda event filtering to trigger the Lambda function only if sales fail when the price is above the specified threshold. Configure the Lambda function to publish the data to an Amazon Simple Notification Service (Amazon SNS) topic.
Create an event source mapping between DynamoDB Streams and an AWS Lambda function. Configure the Lambda function handler code to publish to an Amazon Simple Notification Service (Amazon SNS) topic if sales fail when price is above the specified threshold.
Create an event source mapping between DynamoDB Streams and an Amazon Simple Notification Service (Amazon SNS) topic. Use event filtering to publish to the SNS topic if sales fail when the price is above the specified threshold.
Create an Amazon CloudWatch alarm to monitor the DynamoDB Streams sales data. Configure the alarm to publish to an Amazon Simple Notification Service (Amazon SNS) topic if sales fail due when price is above the specified threshold.
Explanations:
This option uses Lambda event filtering to trigger the function only for failed sales above the specified price threshold, reducing unnecessary processing and development effort. The Lambda function can then easily publish notifications to an SNS topic, making it an efficient solution.
While this option will also trigger the Lambda function for each stream record, it requires more code to filter the events and handle the logic within the function. This increases the development effort compared to option A, where filtering is handled by the event source mapping.
Currently, Amazon SNS does not support direct event filtering from DynamoDB Streams, making this option not feasible. It would not effectively allow for notifications only for failed sales above the threshold, requiring additional handling in a Lambda function, similar to option B.
Amazon CloudWatch alarms cannot monitor DynamoDB Streams directly for specific event attributes like transaction status and price. This would require a more complex setup involving additional components to monitor the data, resulting in higher development effort compared to option A.