Bela Vizy
Bela Vizy

Reputation: 1164

How to set a AWS lambda trigger to Alexa Skills programatically

I'd like to set the trigger of an AWS lambda that uses Alexa events to run the trigger, but I can't find anything in the SDK documentation.

Does anybody know? I would be particularly happy if somebody showed me how to do it with the node.js SDK, but other ideas (CLI) are also welcome.

I was playing around with the event source mapping SDK calls, but it doesn't seem to do the trick. I think the APIs were designed for Kinesis and Dynamo streams and just didn't catch up with latest Alexa development changes.

Upvotes: 7

Views: 2250

Answers (1)

Bela Vizy
Bela Vizy

Reputation: 1164

I have found it. Thanks to this Amazon Developer Forum Article

You need to use the add-permission. Here is a CLI example, but the same parameters worked for me using the node.js SDK:

aws --region us-east-1 lambda add-permission \
--function-name FUNCTIONAME \
--statement-id "1234" \
--action "lambda:InvokeFunction" \
--principal "alexa-appkit.amazon.com"

Upvotes: 6

Related Questions