Reputation: 1759
How do I create an Alexa trigger for a Lambda function using boto3 in Python?
Upvotes: 4
Views: 5852
Reputation: 4185
To update the accepted answer a bit (mid-2018):
Nowadays, for Skill ID Verification, you can add an EventSourceToken
parameter (see boto3 docs on add_permission()
)
function_name = 'foo'
skill_id ='amzn1.ask.skill.xxxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx'
response = client.add_permission(
FunctionName=function_name,
StatementId='AlexaFunctionPermission',
Action='lambda:InvokeFunction',
Principal='alexa-appkit.amazon.com',
EventSourceToken=skill_id)
See the official reference (CLI-based).
Hope that helps someone.
Upvotes: 2
Reputation: 1759
For anyone who may not know how.
response = client.add_permission(
FunctionName='<YOUR_FUNCTION_NAME>',
StatementId='AlexaFunctionPermission',
Action='lambda:InvokeFunction',
Principal='alexa-appkit.amazon.com',)
Upvotes: 2