Serverless Alexa Plugin

Serverless plugin to support Alexa Lambda events

user  

rajington

Serverless Framework now supports Alexa Events directly, without this plugin!

Serverless Alexa Events

Travis build status Code Climate Test Coverage Dependency Status devDependency Status

This plugins compiles the Alexa Skills Kit events to a CloudFormation resource.

It requires Serverless 1.0 or later.

How it works

Compile Alexa Skills Kit Events hooks into the deploy:compileEvents lifecycle.

It loops over all functions which are defined in serverless.yaml. For each function that have Alexa events defined, a lambda permission for the current function is created which makes is possible to invoke the function when the skill is spoken.

Take a look at the Event syntax examples below to see how you can setup an Alexa Skills Kit event.

The resource is then merged into the serverless.service.resources.Resources section.

Event syntax examples

Enable Alexa Skills Kit event:

# serverless.yaml
functions:
    greet:
        handler: handler.hello
        events:
            - alexaSkillsKit

TODO:

I do not believe Alexa Smart Home events are possible via CloudFormation, although they are supported via command-line and SDK.

It may require creating a separate policy to be linked, will have to investigate. The plugin accepts the value and supplies it to CloudFormation, but it currently fails.

Configure Alexa Smart Home event:

# serverless.yaml
functions:
    greet:
        handler: handler.hello
        events:
            - alexaSmartHome: amzn1.ask.skill.1234561242829234567890AB
view on Github

Latest commit b2f54ec on Sep 24, 2017

New to serverless?

To get started, pop open your terminal & run:

npm install serverless -g