This is a serverless application built with Node.js, Serverless Framework AWS Lambda.
- Visual Studio Code
- ASK CLI (Alexa Skills Kit Command Line Interface)
- AWS CLI (Amazon Web Services Command Line Interface)
- Node.js (required for ASK CLI)
- Serverless Framework (
npm install -g serverless
) - AWS Vault
- Clone the repository:
git clone https://github.com/mawaqit/alexa.git
- Change to the project directory:
cd alexa/lambda
- Install the dependencies:
npm install
- Start an AWS Vault session with the
mawaqit-external
profile:
aws-vault exec mawaqit-external
- Change to the project directory:
cd alexa/lambda
- Deploy your functions to AWS Lambda:
serverless deploy -s ${stage} -f indexHandler
Different stages we can use to deploy
dev
prod
lambda/handlers.js
: Contains the function handlers for your serverless functions.lambda/serverless.yml
: Serverless configuration file that defines your functions, events, and resources.lambda/package.json
: Node.js package file that lists your project dependencies./interactionModels
: Contains Interaction Models of different localeslambda/aplDocuments
: Contains APL Documentslambda/prompts
: Contains prompts for different locales
-
Open Visual Studio Code.
-
Go to the Extensions view by clicking on the Extensions icon in the Activity Bar on the side of the window or by pressing
Ctrl+Shift+X
. -
In the search bar, type "Alexa Skills Kit" and press
Enter
. -
Click "Install" on the extension named "Alexa Skills Kit" by Amazon.
-
Open the VS Code terminal by pressing
Ctrl + \
(backtick). -
Type the following command to configure the ASK CLI:
ask configure
-
Follow the prompts to log in with your Amazon developer account and set up the CLI. Make sure to select or create a default profile.
-
In the VS Code terminal, type the following command:
ask configure --profile MAWAQIT
-
Follow the prompts to log in with your Amazon developer account and set up the "MAWAQIT" profile.
-
To ensure that the "MAWAQIT" profile has been created successfully, run the following command:
ask configure list-profiles
-
Make sure the interaction model which you wish to update is available in
/interactionModels
directory. -
Make changes in your required Locale for example in
/interactionModels/en-US.json
-
Navigate to Interaction Models directory using CLI.
cd interactionModels
- To deploy your changes to your Dev Skill to a particular locale for example
en-US
ask smapi set-interaction-model --skill-id amzn1.ask.skill.81a30fbf-496f-4aa4-a60b-9e35fb513506 --stage development --locale ${locale} --interaction-model "file:${locale}.json" -p ${profile} --debug
NOTE:
- Replace
${locale}
with locale name. For Example:en-US
oren-IN
. - Replace
${profile}
with profile name. For example:MAWAQIT