AWS Certified Developer – Associate (DVA-C02) — Question 182
A developer has been asked to create an AWS Lambda function that is invoked any time updates are made to items in an Amazon DynamoDB table. The function has been created, and appropriate permissions have been added to the Lambda execution role. Amazon DynamoDB streams have been enabled for the table, but the function is still not being invoked.
Which option would enable DynamoDB table updates to invoke the Lambda function?
Answer options
- A. Change the StreamViewType parameter value to NEW_AND_OLD_IMAGES for the DynamoDB table.
- B. Configure event source mapping for the Lambda function.
- C. Map an Amazon Simple Notification Service (Amazon SNS) topic to the DynamoDB streams.
- D. Increase the maximum runtime (timeout) setting of the Lambda function.
Correct answer: B
Explanation
The correct answer is B, as setting up an event source mapping is necessary for connecting the DynamoDB stream to the Lambda function, allowing it to be triggered by updates. Option A does not directly trigger the function; it only changes the data sent to the function. Option C involves SNS, which is not required for this direct invocation. Option D pertains to the function's runtime and does not affect the triggering mechanism.