On-demand parameterized nodejs lambda function on greengrass

0

Hi Team,

I would like to receive messages published on a topic from IoT cloud, in nodejs lambda function on greengrass and pass the values in that message as a parameter to nodejs lambda function methods, so that the function executes accordingly.

However, I am not able to find AWS IoT APIs which subscribe to the messages published by IoT cloud.
Can you please provide help on this? It will be helpful if you can provide sample nodejs lambda function code for this.

Best Regards,
NKV

NKV
質問済み 5年前205ビュー
1回答
0

Hi NKV,

You can setup subscriptions for topics between IoT Cloud and your Lambda.
https://docs.aws.amazon.com/greengrass/latest/developerguide/module3-II.html

You can pass values in the message. For example:

def function_handler(event, context):
    #Set to LEDstate
    if event['LEDstate'] == "ON":
        #turn LED ON
       # call some function using these values.
return
AWS
KR-AWS
回答済み 5年前

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

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

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

関連するコンテンツ