How to write Alexa skill data to DynamoDB with AWS Lambda

Creating a skill on the Amazon Developer Portal

  1. Go to Alexa developer console https://developer.amazon.com/alexa/ and add a new skill named “My expenses”.
  2. In the next screen “Choose a model to add to your skill” and pick the “Custom” option.
  3. Create the Interaction model. The quickest way to configure the interaction model is through the “JSON editor” in developer console. Copy and paste the code below in the editor and save the model. This will gives you:
    — invocation name: my expenses
    — Intent AddExpense
    — Sample utterances.
    — Slots - Amount, Category

Create Lambda function

$ serverless create --template aws-nodejsServerless: Generating boilerplate...`
serverless.yml
profile: ${self:custom.profiles.${self:provider.stage}}
...
custom:
defaultStage: dev
profiles:
dev: serverless
prod: serverless
$cat ~/.aws/credentials
[serverless]
aws_access_key_id = XXXX
aws_secret_access_key = XXXX

Testing on your Echo

Solution Architect | Microservice, Serverless Enthusiasts — Connect at https://www.linkedin.com/in/randika/

Love podcasts or audiobooks? Learn on the go with our new app.

Get the Medium app

A button that says 'Download on the App Store', and if clicked it will lead you to the iOS App store
A button that says 'Get it on, Google Play', and if clicked it will lead you to the Google Play store
Randika Rathugamage

Randika Rathugamage

Solution Architect | Microservice, Serverless Enthusiasts — Connect at https://www.linkedin.com/in/randika/

More from Medium

Hosting a serverless web app using AWS Amplify

AWS Serverless or Lambda

AWS Lambda: A Serverless Framework

Creating Serverless APIs on AWS