Configuring the Lambda function

Once the Interaction Model is created, we will leave the Configuration Dashboard as it is and focus on creating the Lambda:

  1. Open a new browser tab and navigate to the AWS console.

The AWS console can be found at https://console.aws.amazon.com. Please note that you may need to create a new account if you do not already have one.

Select Lambda under ServicesCompute options. Click Create a function on the next screen, name the Lambda function ambienceManagerSkill, and fill in the details as shown in the following screenshot:

Figure 6.31: Setting up the Lambda function

Click on the Create function button after filling in the details.

  1. On the next screen, under the Designer section, you will need to add a trigger to invoke the Lambda function. From the list of triggers on the left, please select Alexa Skills Kit since Alexa will be invoking and supplying input to our Lambda function:
Figure 6.32: Adding the trigger to the Lambda function

Once we have added the trigger, we need to add the Skill ID that we copied in the previous section. Scroll to the bottom of the screen and add the Skill ID in the section shown in the following screenshot:

Figure 6.33: Configuring the trigger

Adding the Skill ID ensures that the Lambda responds to only those requests that are generated by the verified skill. After adding the Skill ID, please click on the Add button at the bottom of the screen. Our Lambda configuration should have some unsaved changes now. Please save the recent changes by clicking on Save button in the top-right corner of the screen.

  1. Once you have clicked the Save button, select the ambienceManagerSkill box under the Designer section. This should bring up a code editor at the bottom where we will add the code for the Lambda.
..................Content has been hidden....................

You can't read the all page of ebook, please click here login for view all page.
Reset
3.22.77.149