DynamoDB Triggers allow you to execute custom actions (as code) based on item-level updates on a DynamoDB table.
Some use cases of DynamoDB Triggers include sending notifications, updating an aggregate table, and connecting DynamoDB tables to other data sources.
Creating / Using / Deleting Triggers
Create an AWS Lambda function (with the logic code) and associate the event-source for the function to a stream in DynamoDB Streams. Also, in the settings for the table for which the stream is enabled, you can associate Lambda function.
When the table is updated, the updates are published to Streams. In turn, AWS Lambda reads the updates from the associated stream and executes the code in the function.
You can delete a trigger by deleting the associated AWS Lambda function. You can delete an AWS Lambda function from the AWS Lambda console or throughput an AWS Lambda API call.
Trigger Pricing
With DynamoDB Triggers, you only pay for the number of requests for your AWS Lambda function and the amount of time it takes for your AWS Lambda function to execute.
You are not charged for the reads that AWS Lambda function makes to the stream (via DynamoDB Streams).
Triggers – Important Points
There is no limit on the number of triggers for a table.
Currently, DynamoDB Triggers supports Javascript, Java, and Python for trigger functions. Currently there are no native APIs to create, edit, or delete DynamoDB triggers; you have to use the AWS Lambda console.
DynamoDB Triggers is available in all AWS regions where AWS Lambda and DynamoDB are available.
DynamoDB Streams and AWS Lambda Triggers
Triggers automatically respond to events in DynamoDB Streams, and with triggers, you can build applications that react to data modifications in DynamoDB tables.
You can create triggers that will invoke a Lambda function. AWS Lambda polls the stream and invokes your Lambda function synchronously when it detects new stream records.
- heartin's blog
- Log in or register to post comments
Recent comments