简体   繁体   中英

Use DynamoDB item data with Amazon SQS in an AWS Lambda function?

OK so at this moment in time I have made an AWS Lambda function that takes in an object, translates the object to whatever language, and puts the translated object into DynamoDB.

What I need to do though, is set it up so when an item is put into DynamoDB, that sets a trigger to use the translation function using the data that was just put into DynamoDB. I'm aware I am supposed to use Amazon SQS but I really don't know how to go about it. I can't find any relevant help online.

I have made a queue and set it as a trigger to my function that puts the original object into the db, but thats all I have done. Can anyone help or even point me to the direction of a relevant tutorial or video?

From DynamoDB Streams and AWS Lambda Triggers - Amazon DynamoDB :

Amazon DynamoDB is integrated with AWS Lambda so that you can create triggers—pieces of code that automatically respond to events in DynamoDB Streams. With triggers, you can build applications that react to data modifications in DynamoDB tables.

So, if you configure DynamoDB Streams for your DynamoDB table, it can trigger the Lambda function that performs the translation. There is no need to use an Amazon SQS queue.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM