Created
January 16, 2019 20:12
-
-
Save ScriptAutomate/5af445ba5e0272a2e74a5e7732048b92 to your computer and use it in GitHub Desktop.
Properly Configure Alexa Skill Id Permissions to Invoke Backend Lambda Function with SAM CLI Template
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
AWSTemplateFormatVersion: '2010-09-09' | |
Transform: AWS::Serverless-2016-10-31 | |
Description: Alexa App Hello World Lambda Endpoint | |
Mappings: | |
Variables: | |
AlexaSkillKit: | |
Id: amzn1.ask.skill.xxxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx | |
Globals: | |
Function: | |
Timeout: 3 | |
Resources: | |
HelloWorldFunction: | |
Type: AWS::Serverless::Function | |
Properties: | |
CodeUri: hello_world/ | |
Handler: app.lambda_handler | |
Runtime: python3.6 | |
HelloWorldFunctionAskPermission: | |
Type: AWS::Lambda::Permission | |
DependsOn: HelloWorldFunction | |
Properties: | |
Action: lambda:InvokeFunction | |
EventSourceToken: !FindInMap | |
- Variables | |
- AlexaSkillKit | |
- Id | |
FunctionName: !GetAtt HelloWorldFunction.Arn | |
Principal: alexa-appkit.amazon.com | |
Outputs: | |
HelloWorldFunction: | |
Description: "Alexa Hello World Lambda Function ARN" | |
Value: !GetAtt HelloWorldFunction.Arn | |
HelloWorldFunctionIamRole: | |
Description: "Implicit IAM Role created for Alexa Hello World function" | |
Value: !GetAtt HelloWorldFunctionRole.Arn | |
HelloWorldFunctionAlexaSkillKitId: | |
Description: "Alexa Skill Permitted Lambda Invokation Permissions" | |
Value: !FindInMap | |
- Variables | |
- AlexaSkillKit | |
- Id | |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
NOTE: If one is using Alexa Smart Home as the needed permissions, the
Principal
would instead bealexa-appkit.amazon.com