In the first step of this guide, we built the Voice User Interface (VUI) for our Alexa skill. On this page, we will be creating an AWS Lambda function using Amazon Web Services. You can read more about what a Lambda function is, but for the purposes of this guide, what you need to know is that AWS Lambda is where our code lives. When a user asks Alexa to use our skill, it is our AWS Lambda function that interprets the appropriate interaction, and provides the conversation back to the user.
-
Go to http://aws.amazon.com and sign in to the console. If you don't already have an account, you will need to create one. If you don't have an AWS account, check out this quick walkthrough for setting it up.
-
Click "Services" at the top of the screen, and type "Lambda" in the search box. You can also find Lambda in the list of services. It is in the "Compute" section.
-
Check your AWS region. AWS Lambda only works with the Alexa Skills Kit in two regions: US East (N. Virginia) and EU (Ireland). Make sure you choose the region closest to your customers.
-
Click the "Create a Lambda function" button. It should be near the top of your screen. (If you don't see this button, it is because you haven't created a Lambda function before. Click the blue "Get Started" button near the center of your screen.)
-
Choose the blueprint named "alexa-skill-kit-sdk-factskill". We have created a blueprint as a shortcut to getting everything set up for your skill. You can search for a blueprint using the provided search box. This blueprint adds the alexa-sdk to your Lambda function so that you don't have to upload it yourself.
-
Configure your trigger. Click in the dashed box, and select Alexa Skills Kit from the list. If you don't see Alexa Skills Kit in the list, jump back to step #3 on this page.
Once you have selected Alexa Skills Kit, click the Next button.
-
Configure your function. This screen is where we will enter the important parts of our Lambda function. These values will only ever be visible to you, but make sure that you name your function something meaningful.
-
Upload the provided code We have provided the code for this skill on GitHub.
8.1 From the Code entry type box, choose "Upload a .ZIP file" 8.2 Clone the project and package the skillgit clone [email protected]:alexa/skill-sample-node-device-address-api.git cd skill-sample-node-device-address-api npm install zip -r packagedSkill.zip *
8.3 Click the upload button and upload your zip file.
-
Set up your Lambda function role. Create an AWS Role in IAM with access to Lambda, CloudWatch Logs and DynamoDB.
-
For this guide, you can skip all of the Advanced settings. Click the Next button to move to the Review screen.
-
The Review screen is a summary of your choices. Click Create Function in the bottom left corner. You will need to scroll down to find Create Function.
-
After you create the function, the ARN value appears in the top right corner. Copy this value for use in the next section of the guide.