Exam DVA-C02 All QuestionsBrowse all questions from this 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?

    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
AnandeshOption: 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

AlagongOption: A

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

AnandeshOption: A

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

siheomOption: A

definitely A

tomchandler077

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.