Skip to content

Latest commit

 

History

History
52 lines (29 loc) · 5.57 KB

2-lambda-function.md

File metadata and controls

52 lines (29 loc) · 5.57 KB

Build An Alexa Trivia Skill

Voice User InterfaceLambda FunctionConnect VUI to CodeTestingCustomizationPublication

Setting Up A Lambda Function Using Amazon Web Services

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.

  1. 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.

    Developer Console

  2. 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.

    Lambda

  3. Check your AWS region. AWS Lambda only works with the Alexa Skills Kit in these regions: US East (N. Virginia), US West (Oregon), Asia Pacific (Tokyo) and EU (Ireland). Make sure you choose the region closest to your customers. ß Check Region

  4. Click the orange "Create 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.)

    Create lambda function

  5. There are three boxes labeled "Author from scratch", "Blueprints" and "Serverless Application Repository". Click the radio button in the box titled "Serverless Application Repository" We have created a repository as a shortcut to getting everything set up for your skill.

  6. Search for the application repository named "alexa-skills-kit-nodejs-triviaskill". You can find it using the provided search box.

  7. Click on the repository. This repository will create the Lambda function, add Alexa Skills Kit as it's trigger, and sets up an IAM role for you. It will also add the code from this GitHub repo and include it's dependencies to your Lambda function so that you don't have to upload it yourself.

  8. Click the deploy button at the bottom of the page.

  9. Wait for the status of all resources to change to CREATE_COMPLETE

  10. Click the Test App button to go to the Lambda console.

  11. Open the function that was just created by clicking on it.

  12. If you want to secure this Lambda function follow the instructions found here

  13. Scroll down the page until you see a section called Function code.

  14. Copy the provided code from here into the Lambda function code box. Delete the contents of the code box, and paste the contents of the new code. Click "Save".

  15. You should see the Amazon Resource Name (ARN) a unique identifier for this function in the top right corner of the page. Copy the ARN value for this Lambda function for use in the next section of the guide.

    Copy ARN

Next