Publish to IoT Thing from Lambda Javascript Example

0

Hi folks. We have developed an IoT application and all is going great with the receiving of messages from our IoT Device to trigger Lambda's. The next step is to Publish messages from a Lambda to the device using JavaScript. I can successfully Publish back to the device using the Test option from the web console. I can't seem to find JavaScript sample Lambda code that shows how to connect to a specific Thing and then Publish to it. Would also need to understand the security required for the Lambda connection to the Thing (ie. does the Lambda have to load the same certificates used by the IoT Device).

I appreciate any help.

Thanks. Grant.

Grant
質問済み 1年前457ビュー
1回答
1

You will need to use the NodeJs SDK and import the module IotData.

Look at below and use the publish method to send data to the associated topic and payload:

profile picture
エキスパート
回答済み 1年前

ログインしていません。 ログイン 回答を投稿する。

優れた回答とは、質問に明確に答え、建設的なフィードバックを提供し、質問者の専門分野におけるスキルの向上を促すものです。

質問に答えるためのガイドライン