Search code examples
amazon-dynamodbamazon-dynamodb-streams

Multiple dynamo Stream in One lambda function


I have multiple dynamo db tables in same AWS account, They all have streams enable on them. Can a single lambda function listen to multiple streams?


Solution

    1. Go to your function
    2. Under the Triggers section Click on Add Trigger.
    3. A new dialog will pop up, Click on the shaded box.
    4. Search for DynamoDB and Select it.
    5. Select your DynamoDB table name
    6. Set the Batch size to 1
    7. Set the Starting position Latest
    8. Make sure you click on the Enable Trigger
    9. Click Submit.

    Redo the same thing from step 2 till step 9 but select a different table name.

    1. Save your changes Make sure Lambda has a correct role. ( you can click on the Test button and see the result)

    Now if you insert on any of your tables you should see lambda will get invoke (Check the cloud watch)