Serverless-application-model: Add support for Alexa Smart Home Skill

Created on 11 Jul 2017  路  4Comments  路  Source: aws/serverless-application-model

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:

image

  • Does this feature simplify creating and deploying some aspect of a Serverless application?

    • Yes, lambda function using the alexa smart home trigger could be deployed using CloudFormation.

  • Is this feature solving a problem faced by other Serverless application developers?

    • Yes, I believe so.

  • How do developers work around this problem today?

    • It is possible to deploy the lambda function partially. Some manual steps are required to setup the alexa smart home skill.

  • How is the proposed feature better than the work around?

    • By adding the feature the deployment can be fully automated.

typfeature

Most helpful comment

Any update on when this might get implemented?

All 4 comments

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

Was this page helpful?
0 / 5 - 0 ratings

Related issues

Jacksotnik picture Jacksotnik  路  4Comments

kwcrook picture kwcrook  路  3Comments

feinstein picture feinstein  路  3Comments

willdady picture willdady  路  3Comments

restfulhead picture restfulhead  路  4Comments