Switch branches/tags
Nothing to show
Find file Copy path
Fetching contributors…
Cannot retrieve contributors at this time
116 lines (85 sloc) 4.15 KB

BCH compliance

AWS Lambda in TypeScript


  1. Dependencies
npm install
  1. Download ngrok in the root folder

Run project

  1. Open a console
npm run ngrok

Copy the https link and go to Alexa Console, under Endpoint section, select HTTPS and paste the link in Default Region input field. From the below dropdown choose My development endpoint is a sub-domain of a domain that has a wildcard certificate from a certificate authority. Every time when you run the ngrok, you need to update the endpoint url. [1]

  1. Open another console
npm start


Use npm to install ASK CLI. If you already have ASK CLI installed and want to update to the latest version, install it in the same way as a new user.

$ npm install -g ask-cli

After you install ask-cli, initialize ASK CLI:

$ ask init

You will be prompted to name your profile (default by default), choose the AWS profile to use, and to log in to your Amazon developer account. Once the initialization is complete, you can use ASK CLI to manage your skill.

If you choose to create a new one, first go in AWS IAM, create an user or choose an existing one and create an access key.

Press Add permission button > Attach existing policy > Create policy > open JSON format and paste the following code

    "Version": "2012-10-17",
    "Statement": [
            "Effect": "Allow",
            "Action": [
            "Resource": "arn:aws:iam::*:role/ask-*"
            "Effect": "Allow",
            "Action": [
            "Resource": "arn:aws:lambda:*:*:function:ask-*"
            "Effect": "Allow",
            "Action": [
            "Resource": "arn:aws:logs:*:*:log-group:/aws/lambda/ask-*"

Last step, go to ./ask/config and place you skill_id and your lambda arn.

In order to deploy run:

$ ask deploy

Developer tasks

Frequently used npm scripts:

Script name Description
start Runs the service locally, so you can call your API endpoints on http://localhost.
ngrok Runs the ngrok service locally, so you can use the https endpoint in Alexa skill:
build Clean the build and start a new process to build again the files
clean Clean the build
deploy Build the project and then deploy to aws lambda
sync:model Sync the model from Alexa Skill Console with local model from models folder