What event can be triggered to fire a lambda function in DynamoDB?

落花浮王杯 提交于 2019-12-12 04:24:20

问题


I can't seem to find the documentation on what kinds of events DynamoDB is able to trigger a lambda function based on. All I can find is mentions of when a new record is added to a table or a record is updated. Are those the two "only" actions/events available? Or could I also trigger a lambda function when I request a records that does not exists (which is what I need in my case, where I will be using DynamoDB as a cache)?


回答1:


Triggering a Lambda function automatically because somebody queried for a key that doesn't exist is not supported by DynamoDB. You would have to handle that in your querying code.




回答2:


Triggering AWS Lambda through events happening in DynamoDB is done by utilizing DynamoDB Streams.

As stated in the documentation:

DynamoDB Streams captures a time-ordered sequence of item-level modifications in any DynamoDB table, and stores this information in a log for up to 24 hours.

So they only capture operations which modify data, which isn't the case for read operations.



来源:https://stackoverflow.com/questions/46936182/what-event-can-be-triggered-to-fire-a-lambda-function-in-dynamodb

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!