Skip to content

This project allows you to create your own voice based pick a path adventure which is described as JSON in Dynamo DB using Alexa

Notifications You must be signed in to change notification settings

benleov/alexa-pap

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

4 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Alexa - Pick a path adventure

Introduction

This project allows you to create your own voice based pick a path adventure which is described as JSON in Dynamo DB.

Pre-requisites

General setup

  1. Install ask cli & run ask init to link with your account

  2. Clone the repository.

    $ git clone https://github.com/benleov/alexa-pap.git
  3. Navigating into the repository's root folder.

    $ cd alexa-pap
  4. Install npm dependencies by navigating into the lambda/ directory and running the npm command: npm install

    $ cd lambda/
    $ npm install

Repository Contents

  • /lambda/ - The lambda function that processes requests from alexa
  • /examples/sample-story.json - An example story stored in DynamoDB

Deployment

ASK CLI will create the skill and the lambda function for you. The Lambda function will be created in us-east-1 (Northern Virginia) by default

  1. Deploy the skill and the lambda function in one step by running the following command:

    $ cd .. # to get back to the root directory
    $ ask deploy
  2. Once deployed, additional permissions need to be added to the AWS IAM role being used by the skill since it is persisting data in Amazon DynamoDB. Navigate to the AWS IAM console.

    Note: We are adding the full access policy here for convenience. For a production skill, you should use a more targeted policy restricting access to just the required resources. Refer to the DynamoDB documentation for more details.

    1. Locate the role for your skill (by default, it is named ask-lambda-<your skill name>).
    2. Click on the role, then click Attach Policy.
    3. Search for AmazonDynamoDBFullAccess and click the check box next to it.
    4. Click Attach Policy.

If you deploy this manually (not using the ask cli), please note that:

  • You need to make sure that your Alexa is in the same region and using locale as what you have deployed.
  • You need to deploy the lambda that supports Alexa, such as Ireland (eu-west-1)

Creating your story

Testing

  1. To test, you need to login to Alexa Developer Console, and enable the "Test" switch on your skill from the "Test" Tab.

  2. Simulate verbal interaction with your skill through the command line using the following example:

     $ ask simulate -l en-US -t "start pick a path game"
    
     ✓ Simulation created for simulation id: 4a7a9ed8-94b2-40c0-b3bd-fb63d9887fa7
      Waiting for simulation response{
      "status": "SUCCESSFUL",
      ...

Note: if you did not add the DynamoDB permission as described in the previous step, the skill will return an error and you will see an error in your CloudWatch Logs reporting: ...Coud not read item...is not authorized to perform: dynamodb:GetItem...

  1. Once the "Test" switch is enabled, your skill can be tested on devices associated with the developer account as well. Speak to Alexa from any enabled device, from your browser at echosim.io, or through your Amazon Mobile App and say :

    Alexa, start pick a path game
    

About

This project allows you to create your own voice based pick a path adventure which is described as JSON in Dynamo DB using Alexa

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published