Learn how to use the Jovo CLI to deploy your Alexa Skill and Google Action to AWS Lambda from the command line.
Introduction
The majority of Alexa Skills is hosted on AWS Lambda, and Jovo allows you to host your Google Actions there as well. Debugging your Lambda functions can be quite tedious and time consuming though, if you're always uploading and saving your code manually. Fortunately, the Jovo CLI offers integrations to ASK CLI and AWS to deploy your code to Lambda right from the command line.
You can upload your voice app to AWS Lambda by using the command jovo deploy
, but first, you need to create the Lambda function, add it as an endpoint to your project.js
, and make sure you have the right AWS credentials to programmatically deploy it there.
Add Lambda ARN as Endpoint
This article assumes you already have a Lambda function or know how to create one. If you need help with that, take a look here: Alexa Skill Tutorial: Host your Code on AWS Lambda.
After creating your AWS Lambda function, you can find its resource number (the ARN
) in the upper right corner of the console:
Now copy this and add it as an endpoint to your project.js
file:
One likely setup could be to have a local
stage with the Jovo Webhook for local development, and a dev
stage shared with the team hosted on AWS Lambda:
Set up Credentials with ASK CLI
Jovo currently uses ASK CLI to fetch the AWS credentials associated with an ASK profile. To install ASK CLI, take a look at this quickstart guide: Amazon Docs: Install and Initialize ASK CLI.
Each ASK profile can be mapped to an AWS profile. There are several commands you can use:
You can also directly edit the credentials by taking a look at the .aws
folder in your home directory. This contains a credentials
file that stores your AWS credentials and is structured like this (default
profile as an example):
Learn more in the official Amazon Docs: Set Up Credentials for an Amazon Web Services (AWS) Account.
jovo deploy
After you have everything ready, you can use the jovo deploy
command to automatically upload the code to AWS Lambda:
Alternatively, you can also generate a zip file that can be uploaded to Lambda manually: