Build an AWS Lambda Function for an Alexa Skill (Amazon Echo)

Build an AWS Lambda Function for an Alexa Skill (Amazon Echo)

55 minutes 10 Credits

SPL-118 - Version 2.1.6

© 2019 Amazon Web Services, Inc. and its affiliates. All rights reserved. This work may not be reproduced or redistributed, in whole or in part, without prior written permission from Amazon Web Services, Inc. Commercial copying, lending, or selling is prohibited.

Errors or corrections? Email us at

Other questions? Contact us at


In this lab, you will create an example Alexa skill. You will then use a blueprint to build an AWS Lambda Function to execute the skill. You will use both the AWS Console and the Amazon Developer Portal in this lab. You will test your function in the Lambda console by sending it JSON requests, and you will test your example skill in the Amazon Developer portal. You do not need an Alexa device for this lab. The Developer Portal provides testing tools that work in a browser.

Topics covered

By the end of this lab, you will be able to:

  • Create a simple Alexa skill in the Amazon Developer Portal
  • Create a Lambda function using a blueprint that can execute an Alexa skill
  • Configure the Alexa skill to use your Lambda function
  • Test your Lambda function in the AWS Management Console
  • Test your Alexa skill in the Developer Portal

Lab Pre-requisites

To successfully complete this lab, you should be familiar with AWS Lambda through taking the introductory lab. Python and JSON programming are required, although full solution code is provided. You will need to have/create a no-cost, no-credit-card-required account in the Amazon Developer Portal. Familiarity with the Amazon Developer Portal and the Alexa Skills Kit is helpful, though not required. You do not need an Alexa device for this lab.

Other AWS Services

Other AWS Services than the ones needed for this lab are disabled by IAM policy during your access time in this lab. In addition, the capabilities of the services used in this lab are limited to what's required by the lab and in some cases are even further limited as an intentional aspect of the lab design. Expect errors when accessing other services or performing actions beyond those provided in this lab guide.

What is AWS Lambda?

AWS Lambda is a compute service that provides resizable compute capacity in the cloud to make web-scale computing easier for developers. You can upload your code to AWS Lambda and the service can run the code on your behalf using AWS infrastructure. AWS Lambda supports multiple coding languages: Node.js, Java, or Python. You upload the code for your Alexa skill to a Lambda function and Lambda does the rest, executing it in response to Alexa voice interactions and automatically managing the compute resources for you. For basic testing of your Alexa skill, you can invoke your function manually by sending it JSON requests in the Lambda console.

Lambda passes on to you the financial benefits of Amazon's scale. AWS Lambda executes your code only when needed and scales automatically, from a few requests per day to thousands per second. For most developers, the Lambda free tier is sufficient for supporting an Alexa skill.

This lab guide explains basic concepts of AWS in a step by step fashion. However, it can only give a brief overview of Lambda concepts. For further information, see the official Amazon Web Services Documentation for Lambda at For pricing details, see

Amazon Alexa Skills

Alexa is the voice service that powers Amazon Echo. Alexa provides capabilities, or skills, which enable customers to interact with devices using voice (answer questions, play music, and more).

The Alexa Skills Kit (ASK) is a collection of self-service APIs, tools, documentation, and code samples that make it easy for you to develop your own Alexa skills, which you can then publish. ASK supports simple command-oriented skills, such as "Alexa, ask Greeter to say hello world" as well as sophisticated multi-command dialogs and parameter passing, such as "Alexa, what is this weekends weather forecast?" The Alexa Skills Kit is a low-friction way to learn to build for voice. You can get a prototype up and running within hours.

Example of a simple command-oriented skill:

Learn more about developing with the Alexa Skills Kit at

Build an AWS Lambda Function for an Alexa Skill (Amazon Echo)

In this lab, you will create an example Alexa skill in the Amazon Developer portal. You will need to create an account on the Amazon Developer Portal if you do not have one already (free of charge). Next, in the AWS Console, you will use a blueprint to create a new Lambda function to support the skill. You will configure your Alexa skill to use the Lambda function, then test both your Lambda function and your new skill.

You do not need an Alexa device for this lab. The Developer Portal provides testing tools that work in a browser.

Join Qwiklabs to read the rest of this lab...and more!

  • Get temporary access to the Amazon Web Services Console.
  • Over 200 labs from beginner to advanced levels.
  • Bite-sized so you can learn at your own pace.
Join to Start This Lab