Can a lamda Function handle event type other than JSON?

0

I am sending data to IOT Core in the string format , i created a rule to forward it to a lamda function, but can this lamda function process string events and not json? Can i get a code layout?

已提问 1 年前248 查看次数
2 回答
3
已接受的回答

If the data is not JSON, Lambda will fail.
So, base64 encode the data to be passed to Lambda in IoT Core as follows.

SELECT encode(*,'base64') as payload FROM '/test/hoge'

In Lambda, when an event is received, the code is written so that base64 decoding is performed and the data is restored.

profile picture
专家
已回答 1 年前
0

The Lambda function will get the event as a JSON format. It may include a string field in it that includes the data from the IoT device.

profile pictureAWS
专家
Uri
已回答 1 年前

您未登录。 登录 发布回答。

一个好的回答可以清楚地解答问题和提供建设性反馈,并能促进提问者的职业发展。

回答问题的准则