Bird
0
0

How do you correctly set up an AWS Lambda function to respond to changes in a DynamoDB table using Streams?

easy📝 Syntax Q3 of 15
DynamoDB - with Serverless
How do you correctly set up an AWS Lambda function to respond to changes in a DynamoDB table using Streams?
AEnable DynamoDB Streams on the table and add the Lambda function as an event source mapping
BConfigure the Lambda function to poll the DynamoDB table every minute
CAttach the Lambda function directly to the DynamoDB table without Streams
DUse AWS Glue to connect Lambda and DynamoDB
Step-by-Step Solution
Solution:
  1. Step 1: Enable DynamoDB Streams

    Streams must be enabled on the DynamoDB table to capture data changes.
  2. Step 2: Create event source mapping

    Configure Lambda to use the DynamoDB Stream as an event source, so it triggers on changes.
  3. Final Answer:

    Enable DynamoDB Streams on the table and add the Lambda function as an event source mapping -> Option A
  4. Quick Check:

    Streams + event source mapping triggers Lambda [OK]
Quick Trick: Enable Streams and map Lambda as event source [OK]
Common Mistakes:
MISTAKES
  • Polling the table instead of using Streams
  • Not enabling Streams on the table
  • Trying to attach Lambda directly without Streams

Want More Practice?

15+ quiz questions · All difficulty levels · Free

Free Signup - Practice All Questions
More DynamoDB Quizzes