How to notify failed DynamoDB sales above a price threshold with least effort?

A company that has large online business uses an Amazon DynamoDB table to store sales data. The company enabled Amazon DynamoDB Streams on the table. The transaction status of each sale is stored in a TransactionStatus attribute in the table. The value of the TransactionStatus attribute must be either failed, pending, or completed. The company wants to be notified of failed sales where the Price attribute is above a specific threshold. A developer needs to set up notification for the failed sales. Which solution will meet these requirements with the LEAST development effort?

  1. 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. Source Reference Answer
  2. 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.
  3. 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.
  4. 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.

Community Votes

A
77%
C
23%

77% of anonymous learners picked answer A. Votes are pick records left by other test-takers — they are not the verified answer.

Community Insight

The question tests whether candidates know that Lambda event filtering can evaluate DynamoDB Stream record payloads (including numeric comparisons) so the function is invoked only when conditions match, reducing development effort.

Use DynamoDB Streams with an AWS Lambda event source mapping and Lambda event filtering to trigger notifications only for failed high-value sales, minimizing code and invocation overhead.

Many candidates pick option C, assuming DynamoDB Streams can be wired directly to an SNS topic with an SNS subscription filter policy; in reality, DynamoDB Streams only support Lambda (and a few other services) as event source destinations, not SNS directly.

Community Discussion (7 comments)

Saudis 👍 1
why not D ??
albert_kuo 👍 1 Selected: A
Lambda event filtering { "eventName": ["MODIFY"], "dynamodb.NewImage.TransactionStatus.S": ["failed"], "dynamodb.NewImage.Price.N": [{"numeric": [">", 100]}] }
Anandesh 👍 3 Selected: A
Correction, answer should be A https://docs.aws.amazon.com/lambda/latest/dg/invocation-eventfiltering.html#filtering-ddb
Alagong 👍 4 Selected: A
DynamoDB Streams cannot be directly mapped to SNS. This option is not feasible as described. So C is wrong.
siheom 👍 2 Selected: A
definitely A
tomchandler077 👍 1
A By using event filtering, the Lambda function will only be triggered if the conditions (TransactionStatus is 'failed' and Price is above the specified threshold) are met. This reduces unnecessary executions and simplifies the logic within the function.
Anandesh 👍 3 Selected: C
dynamodb can be mapped as an event source to SNS. While creating the table, we can turn the stream on. We can push events to SNS topic and apply filter policy

Comments & Corrections

No comments yet — spotted an error or have a note? Share it below.

Log in to comment, report an error, or add a note about this question.

Submitted for moderation before publishing. Keep it helpful and respectful.

Expert Analysis

The requirement is to notify only when TransactionStatus is failed AND Price exceeds a threshold, with the LEAST development effort. The optimal pattern is:

  • Enable DynamoDB Streams (already done).
  • Create an event source mapping from the stream to an AWS Lambda function.
  • Use Lambda event filtering to restrict invocations to records where dynamodb.NewImage.TransactionStatus.S = "failed" and dynamodb.NewImage.Price.N satisfies a numeric condition such as ["numeric": [">", threshold]].
  • Inside the tiny Lambda handler, publish the filtered payload to an Amazon SNS topic.
This matches Option A. Lambda event filtering is performed by the service before the function is invoked, so the function code stays minimal — just an SNS publish call — which directly satisfies the "least development effort" constraint.

Why the other options are wrong:

  • Option B also uses Lambda + SNS, but performs the filtering inside the handler code. This works, but it requires writing, testing, and maintaining conditional logic in the function, so it is more development effort than using native event filtering.
  • Option C claims you can map DynamoDB Streams directly to an SNS topic and rely on SNS filter policies. DynamoDB Streams does not support SNS as a direct event source destination; it supports Lambda, Kinesis Data Streams, and a few other targets. Therefore this design is not feasible.
  • Option D suggests using a CloudWatch alarm on DynamoDB Streams data. CloudWatch alarms operate on metrics, not on individual stream records or attribute values, so they cannot evaluate per-record conditions like "TransactionStatus = failed and Price > X". This option is architecturally incorrect.
Community comments reinforce this: candidates who initially leaned toward C or D corrected themselves after reviewing the Lambda event filtering documentation for DynamoDB, confirming that A is the only valid and minimal-effort solution.

Official Reference

Exam Strategy

When a question emphasizes 'LEAST development effort' and involves per-record attribute conditions on a stream, immediately look for the answer that uses native event filtering at the event source mapping rather than in-function logic. Also eliminate options that wire DynamoDB Streams to unsupported targets like SNS directly.

Related Analysis

Practice All DVA-C02 Questions

Access 100 questions with complete answers and detailed explanations.

View Full DVA-C02 Practice Test →

← Back to DVA-C02 Study Guide