Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

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.

like image 673
Bela Vizy Avatar asked Sep 14 '16 13:09

Bela Vizy


1 Answers

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"
like image 159
Bela Vizy Avatar answered Oct 05 '22 21:10

Bela Vizy