Closed PMudra closed 6 years ago
We are running into the same problem right now. I've spent some time today trying to figure out if it can somehow be done programmatically. But, if I did not miss anything, CloudFormation AWS::Lambda::Permission
is missing support for Condition
, which would be required to add the Smart Home Skill Trigger.
So the following does not work:
AlexaSmartHomeExecutionPermission:
Type: AWS::Lambda::Permission
DependsOn: AlexaLambda
Properties:
Action: lambda:InvokeFunction
FunctionName: !GetAtt AlexaLambda.Arn
Principal: alexa-connectedhome.amazon.com
Condition:
StringEquals:
lambda:EventSourceToken: "amzn1.ask.skill.<UUID>"
It would be great if we could specify the AWS::Serverless::Function
like this:
AlexaLambda:
Type: AWS::Serverless::Function
Properties:
CodeUri: <CodeURI>
Handler: lambda.handler
Description: 'Amazon Alexa Service'
MemorySize: 128
Runtime: nodejs6.10
Timeout: 30
Events:
Type: AlexaSmartHome
Properties:
EventSourceToken: "amzn1.ask.skill.<UUID>"
Thanks. This is a good feature request. We can support it natively in SAM once CloudFormation's Lambda::Permission resource supports EventSourceTokens.
Any update on when this might get implemented?
Tracking this in PR #363
SAM already includes AlexaSkill as event source type. It would be great if Alexa Smart Home Skills were also supported.
For example I cannot (completely) export my lambda function when using a alexa smart home as trigger: