简体   繁体   中英

Upload file to AWS EC2 Server from AWS IoT device using AWS lambda function

What I intend to do:

I am receiving a file from a device connected to AWS IoT and I would like to send that file to AWS EC2 server using a AWS Lambda function. Lambda function is like the middle man which passes the file.

My questions is:

The rule in AWS IoT says "Insert this message into a code function and execute it (Lambda)". When I select this, will this send the file to Lambda sent by the device to IoT or am I supposed to write a function in lambda to subscribe to the device.

My question in brief is when I create a rule in IoT and choose an action as Lambda, what happens then? Does it forward the file to lambda? If yes then how do I receive it from the lambda function? It would be great if I could get some example function for it.

When you create an IoT rule choosing lambda. The lambda you chose will receive the message sent to IoT in the event.

You may want to take a look at this tutorial , where IoT triggers a lambda to update a DynamoDB table (change Dynamo for your EC2).

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