The primary purpose of this container is to use the aws / ask / bespoken toolchains to test our alexa invocation names for SpokenLayer's interactive branded alexa skills.
It is also a prototype for a general Alexa Skill Management Server (asms)
- Locally install & setup the AWS CLI, the ASK CLI, the bespoken.io CLI, and jq.
- Initialize all three CLIs with proper credentials
- Create a new lambda using AWS CLI (example command below) and the files in
/lambda
and note down the lamda arn
aws lambda create-function \
--region region \
--function-name alexa-invocation-tester \
--zip-file fileb://lambda/Archive.zip \
--role role-arn \
--handler index.handler \
--runtime nodejs8.10 \
--profile adminuser
- Update
skill/skill.json
with your new lambda arn - Create a new Alexa Skill using the ASK CLI & the json manifests in
/skill
ask api create-skill --file "skill/skill.json" --profile PROFILE --debug
ask api update-model --skill-id "amzn1.foo.bar" --file "skill/en-US.json" --locale "en-US" --profile PROFILE --debug
- Enable your Alexa Skill for testing using the ASK CLI or web console
ask api enable-skill --skill-id "amzn1.foo.bar" --profile PROFILE --debug
- Link your Lambda & Alexa Skill within the AWS Lambda console so can talk to each other
- Rename the
.env.example
file to.env
and update theSKILLID
,LAMBDAID
, andPROFILE
variables with your skill id, lambda arn, and ask profile name - Build the docker image:
docker build -t asms .
- Run the container by passing in your env variables + ask/aws/bst credentials and forwarding the server to your local machine at port 80:
docker run --name asms -it --rm \
-p 80:5000 \
-v ~.aws:/home/node/.ask \
-v ~.ask:/home/node/.aws \
-v ~.bst:/home/node/.bst \
--env-file ./.env \
asms"
- Go to http://localhost:80 in your browser and test an invocation name. Tests can take 3-4 minutes, so please be patient.
- Test the invocation name on a physical device linked to your amazon dev / ASK account. Sometimes the 1st test fails due to timing, but passes IRL.
- Press the 'test another invocation' button. Wash. Repeat.
- Since you are modifying a real lambda/alexa skill, you can only run 1 test at a time. If you need to cancel an inprogress test or get stuck in a "another test is running" situation, go to http://localhost:80/reset to reset the app and try again.