This is a basic introduction to Lambda triggers that uses DynamoDB as an event source example.

We talk a lot about the more advanced level of Lambda triggers in our popular two-part series: Complete Guide to Lambda Triggers.

We’re going back to the basics this time because skipping some steps when learning something new might get you confused. It tends to get annoying, or it can even make you frustrated. Why?

To understand how something works appropriately and later on to know how to apply your knowledge practically without stress, you must master the particular subject in a particular order.

Let me put it this way: you can’t calculate how fast is a subatomic particle moving in space if it’s 300 lightyears away from the closest planet if you don’t know the basic math, like 3.14 times 42, right?

So, back to our topic here, what are AWS Lambda triggers?

Lambda Triggers Explained with DynamoDB Integration

DynamoDB is an AWS product just like Lambda, and therefore you’re able to create triggers with ease. Triggers are pieces of code that will automatically respond to any events in DynamoDB Streams.

Triggers allow you to build applications that will then react to any data modification made in DynamoDB tables. By enabling DynamoDB Streams on a table, you will be able to associate an ARN with your Lambda function. Instantly after an item in the table is modified, a new record will appear in the table’s stream. When AWS Lambda detects a new stream record, it will invoke your Lambda function synchronously.

Lambda functions can perform any actions you specify, like sending notifications or a workflow initiation.

An example: suppose you have a mobile gaming app that’s writing on a GameScores table. Each time the TopScore attribute of the GameScores table is updated, a corresponding stream record will be written to the table’s stream. You can then set a Lambda function to post a message on social media sites once the event is triggered.

#aws-lambda #aws #aws-services #dynamodb #serverless

Triggering AWS Lambda Events with DynamoDB Integration
1.10 GEEK