Chevron Left Icon
Creating Your Lambda function
Lesson 1 of 2
Chevron Right Icon
  1. 1

    When a user asks Alexa to open a skill, the request is routed to the skill’s back-end, which determines what behavior was requested and an appropriate response. In this lesson, you will create that…

  2. 2

    If you already have an AWS account, sign into the AWS console at aws.amazon.com , and skip to the next exercise. — #### Create an AWS Account (Free Tier) — If you do not have an AWS accou…

  3. 3

    To find Lambda in the console: 1. Make sure you’re logged in to the AWS console at aws.amazon.com . 2. Click Services at the top of the screen, and type “Lambda” in the search box. You can als…

  4. 4

    —- #### Create Lambda Function —- If you haven’t created a Lambda function before, click the orange Get Started button near the center of your screen. If you have created a Lambda function…

  5. 5

    After creating the skill, you will find the Lambda Configuration Page. This gives you access to your function code, triggers, roles, policies, and resources . It also lists your function’s name an…

  6. 6

    The index.js file on the right contains the code from the Build Your First Alexa Skill course. We will use this code to create our own function, but before we do that, let’s make it a bit m…

  7. 7

    We are now ready to paste our code into the AWS Lambda Function code section.

  8. 8

    We are now ready to connect our Lambda function to the interaction model we created in the Build Your First Alexa Skill course. (These next steps require a “Codecademy” interaction model and an…

  9. 9

    Congrats! You made your first Lambda function and you have the skills to publish your own! You can reference this course as you need, but please don’t use the “Codecademy” name or “code academy” in…

  1. 1

    In the first lesson, you copied code from Codecademy and pasted it into your AWS account. In this lesson, we will walk you through that code, which lays the foundation for more advanced Alexa conce…

  2. 2

    With the SDK imported, we can begin defining the skill’s logic. Our code will be organized into objects called response handlers, which (i) makes our code easier to maintain and (ii) allows us to…

  3. 3

    Answer to the previous exercise: Handler2 is the first one that can handle the request, so its […] method will be executed. Now let’s write some request handlers! One of your skill’s intents …

  4. 4

    We have a […] method for the […] , which returns […] when the request type is […] and the request intent name is […] . At this point we need to add the code that will return a JSO…

  5. 5

    We can request a response from our skill in two ways: Style 1: “Alexa, tell code academy hello” and Style 2: “Alexa, open code academy” — #### Style 1: IntentRequest — When the us…

  6. 6

    So far our code states that the […] can handle requests of type […] . But how should it handle that request? Alexa should speak back to the user: “Welcome to Codecademy”. We can use […]…

  7. 7

    If all goes well, our skill’s users can say “Alexa, tell code academy hello”, which sends a […] request, and get the response “Hello John”. They can also say “Alexa, open code academy”, which s…

  8. 8

    We’ve defined our requests and error handlers, but how does AWS Lambda call them, and how does it know which to execute? We’ll create and export one function that accesses those handlers in the or…

  9. 9

    You just built your first Lambda function! In this lesson you: Imported the SDK using […] Wrote handler objects with […] and […] methods * Built responses using the […] , […] …

What you'll create

Portfolio projects that showcase your new skills

Pro Logo

How you'll master it

Stress-test your knowledge with quizzes that help commit syntax to memory

Pro Logo