7. Create an Alexa Lambda function

In this step, we will create a lambda function for Alexa backend fulfillment and configure the endpoint for Alexa.

  1. Go to AWS Console

  2. Click the orange Create function button. It should be near the top of your screen.

  3. Click the radio button in the box titled “Browse serverless app repository”. We have created an application in the repository as a shortcut to getting everything set up for your skill.

  4. Enter alexa-skills-kit-nodejs-factskill to search for the application repository.

  5. Click on the application. This template will create the Lambda function, grant the Alexa Skills Kit permission to invoke it, and set up an IAM role for you. It will also add the code from this GitHub repo and include the required dependencies so that you don’t have to upload them yourself

  6. Change the application name and then Click the Deploy button at the bottom of the page.

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

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

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

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

  11. Replace it with the code in alexa-lambda-personal-banker.js, be sure to click Save

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

  13. Go back to the Alexa Developer Console. You may still have a browser tab open if you follow this tutorial. Select the skill you created

  14. Select the Endpoint tab on the left side navigation panel

  15. Select the AWS Lambda ARN option for your endpoint. You have the ability to host your code anywhere that you would like, but for the purposes of simplicity and frugality, we are using AWS Lambda

  16. Paste your Lambda’s ARN (Amazon Resource Name) into the textbox provided for Default Region.

  17. Click the Save Endpoints button at the top of the main panel