This assumes you are familiar with all the steps to setup a skill in developer.amazon.com and aws.amazon.com. If not, start here.
The high level steps are:
Sign In to developer.amazon.com and create a new skill called Travel Browser with invocation name: "travel browser".
From the Build tab:
- Click "JSON Editor" and paste in the /models/en-US.json file to define the language model.
- Click "Interfaces" and enable the Display Interface option.
- Click "Build Model"
- Go to the AWS IAM console
- Locate your skill's Role, sometimes called "lambda_basic_execution",
- Verify or attach a policy such as DynamoDBFullAccess, to grant your Lambda function access to the DynamoDB service.
There will be many AWS components by the time the entire app is finished. To be safe, create all components in the region 'us-east-1' aka N. Virginia.
- Create a new Lambda Function. Start with a blank function.
- Select an ASK Trigger from the left, scroll down and Disable Skill ID verification for now, and scroll up click SAVE.
- Update the Execution Role to the existing role you just updated.
- From a command prompt, navigate to /lambda/custom
- Type
npm installNode.JS will download and install several packages to the node_modules folder. You can optionally delete the node_modules/aws folder to save space. - Type
cd ../.. - Zip and upload the contents of the /lambda/custom folder to your Lambda function. You can use the CLI or run ./deploylambda.sh to automate this step. First run
chmod 755 *.shto make the script executable. - Test your skill with a complete interaction, such as "open travel browser" and "stop".
- The skill may fail the first time, it will be creating a new DynamoDB table for you called askMemorySkillTable.
- Test again, for example, "tell travel browser my name is sam", then "stop". When you return to the skill you should be greeted with a first name.
- Review the Alexa App cards and any Echo Display screen to see visual content.
The skill can generate a new random pass phrase.
- Launch the skill, and say "link session"
- The skill should respond with instructions including a three-part pass phrase, such as Fast Car 345.
You may create the table in advance, just use a primary key of "id" (string). The ask-sdk will create a new table if needed upon first use of persistent attributes. The table name, and many other settings, are set in the /lambda/custom/constants.js file (or when launching a SAM stack). You can view the Tables Console to create and query the table.