How to set a AWS lambda trigger to Alexa Skills programatically

北战南征 提交于 2019-12-04 11:33:03

问题


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.


回答1:


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"


来源:https://stackoverflow.com/questions/39492222/how-to-set-a-aws-lambda-trigger-to-alexa-skills-programatically

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!