DVA-C02 Exam QuestionsBrowse all questions from this exam

DVA-C02 Exam - Question 396


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?

Show Answer
Correct Answer: A

To meet the requirements with the least development effort, an event source mapping between DynamoDB Streams and an AWS Lambda function is ideal. Using Lambda event filtering, the Lambda function will be triggered only when the specified conditions (TransactionStatus is 'failed' and Price is above the specified threshold) are met. This approach minimizes unnecessary executions and simplifies the logic within the function. Then, the Lambda function can be configured to publish the data to an Amazon Simple Notification Service (Amazon SNS) topic, effectively handling notifications for failed sales.

Discussion

5 comments
Sign in to comment
AnandeshOption: C
Jul 5, 2024

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

AlagongOption: A
Jul 17, 2024

DynamoDB Streams cannot be directly mapped to SNS. This option is not feasible as described. So C is wrong.

tomchandler077
Jul 7, 2024

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.

siheomOption: A
Jul 12, 2024

definitely A

AnandeshOption: A
Jul 20, 2024

Correction, answer should be A https://docs.aws.amazon.com/lambda/latest/dg/invocation-eventfiltering.html#filtering-ddb