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년 전

로그인하지 않았습니다. 로그인해야 답변을 게시할 수 있습니다.

좋은 답변은 질문에 명확하게 답하고 건설적인 피드백을 제공하며 질문자의 전문적인 성장을 장려합니다.

질문 답변하기에 대한 가이드라인

관련 콘텐츠