User Tools

Site Tools


using_lambda

Differences

This shows you the differences between two versions of the page.

Link to this comparison view

Both sides previous revisionPrevious revision
Next revision
Previous revision
using_lambda [2016/12/29 13:29] tbrodeurusing_lambda [2016/12/29 17:21] (current) tbrodeur
Line 1: Line 1:
-<fc #008000><fs large>Create a Lambda Function to Interface with the Alexa Skills Kit</fs></fc> +<fc #008000><fs x-large>Create a Lambda Function to Interface with the Alexa Skills Kit</fs></fc> 
-----+<color #22b14c>----------------------------------------------------------------------------------------------------------------------------- 
 +</color>
  
-**-To use lambda, you must first create an [[https://aws.amazon.com/|AWS]](Amazon Web Services) account.+<fs small> 
 +**Author:** Tristan Brodeur  
 + 
 +**Email:** brodeurtristan@gmail.com 
 + 
 +**Date:** Last modified on 12/29/16  
 + 
 +**Keywords:** Alexa, Lambda</fs> 
 + 
 +<color #22b14c>----------------------------------------------------------------------------------------------------------------------------- 
 +</color> 
 + 
 +<fs medium>**Overview**</fs> 
 + 
 +AWS Lambda is a service that executes code in response to events, thus saving the developer the trouble of maintaining a server. Lambda also links seamlessly to the Alexa Skills Kit, which makes it an excellent tool for running the code for Alexa Skills. 
 + 
 +<color #22b14c>----------------------------------------------------------------------------------------------------------------------------- 
 +</color> 
 + 
 +-To use lambda, you must first create an [[https://aws.amazon.com/|AWS]](Amazon Web Services) account.
  
 -If you already have an account, sign in. Create an account if you do not, using the free tier account. -If you already have an account, sign in. Create an account if you do not, using the free tier account.
Line 10: Line 30:
 -Click the Lambda service under the list of services. -Click the Lambda service under the list of services.
  
--Once you click "Get started now" in the next screen, a list of blueprints will follow. Select "Blank Function" from the list.** +-Once you click "Get started now" in the next screen, a list of blueprints will follow. Select "Blank Function" from the list.
- +
-----+
  
 +<color #22b14c>-----------------------------------------------------------------------------------------------------------------------------
 +</color>
 {{:screen_shot_2016-12-28_at_6.01.16_pm.png|}} {{:screen_shot_2016-12-28_at_6.01.16_pm.png|}}
  
  
-----+<color #22b14c>----------------------------------------------------------------------------------------------------------------------------- 
 +</color>
  
 -In the next screen, you must link your lambda function to the Alexa Skills Kit. Click the blank box and choose "Alexa Skills Kit" from the list of drop-downs. -In the next screen, you must link your lambda function to the Alexa Skills Kit. Click the blank box and choose "Alexa Skills Kit" from the list of drop-downs.
  
-----+<color #22b14c>----------------------------------------------------------------------------------------------------------------------------- 
 +</color>
  
 {{:screen_shot_2016-12-28_at_6.03.13_pm.png|}} {{:screen_shot_2016-12-28_at_6.03.13_pm.png|}}
  
-----+<color #22b14c>----------------------------------------------------------------------------------------------------------------------------- 
 +</color>
  
 -The next step is to configure your function. In the name field, enter a descriptive name for the function. This will, however, not be the name that users will invoke to call your function. Next, enter a description for your function. Then select the server language you will choose to run your code. -The next step is to configure your function. In the name field, enter a descriptive name for the function. This will, however, not be the name that users will invoke to call your function. Next, enter a description for your function. Then select the server language you will choose to run your code.
  
-----+<color #22b14c>----------------------------------------------------------------------------------------------------------------------------- 
 +</color>
 {{:screen_shot_2016-12-28_at_6.08.42_pm.png|}} {{:screen_shot_2016-12-28_at_6.08.42_pm.png|}}
  
-----+<color #22b14c>----------------------------------------------------------------------------------------------------------------------------- 
 +</color>
  
 -Scroll down and configure the rest of the options before entering in the code. -Scroll down and configure the rest of the options before entering in the code.
  
-----+<color #22b14c>----------------------------------------------------------------------------------------------------------------------------- 
 +</color>
  
 {{:screen_shot_2016-12-29_at_12.12.10_pm.png|}} {{:screen_shot_2016-12-29_at_12.12.10_pm.png|}}
  
-----+<color #22b14c>----------------------------------------------------------------------------------------------------------------------------- 
 +</color>
  
 -Handler specifies the runtime language function that Lambda should -Handler specifies the runtime language function that Lambda should
Line 46: Line 73:
 name>.<function name> name>.<function name>
  
--<file name> can be replaced with the name of your file if uploaded via zip, or leave it as is if using the inline editor.<function name> can be replaced with the name of your function used to pass the json file to. For this tutorial, we'll leave the handler as is.+-<file name> can be replaced with the name of your file if uploaded via zip, or leave it as is if using the inline editor.<function name> can be replaced with the name of your function used to pass the json file to.  
 + 
 +-//If you are following the "Hello World" tutorial, leave the handler as is.//
  
 -Role specifies the IAM security role to use when running the Lambda -Role specifies the IAM security role to use when running the Lambda
Line 57: Line 86:
 Leave the other drop-down as is and click allow. Leave the other drop-down as is and click allow.
  
-----+<color #22b14c>----------------------------------------------------------------------------------------------------------------------------- 
 +</color>
 {{:screen_shot_2016-12-28_at_6.33.17_pm.png|}} {{:screen_shot_2016-12-28_at_6.33.17_pm.png|}}
  
-----+<color #22b14c>----------------------------------------------------------------------------------------------------------------------------- 
 +</color>
  
 -When defining a Lambda function, you can either write your code in -When defining a Lambda function, you can either write your code in
Line 67: Line 98:
 functions, or if you need to split your code into multiple files (for functions, or if you need to split your code into multiple files (for
 example if you use libraries), the zip file approach is the way to go. example if you use libraries), the zip file approach is the way to go.
 +
 +-//If you are following the "Hello World" tutorial, grab the code from [[echo_hello_world|this page]] and paste it in the inline editor//
  
 -Once the code is added, scroll down to the end of the page and click Next to save the -Once the code is added, scroll down to the end of the page and click Next to save the
Line 78: Line 111:
 check to make sure the trigger is set to Alexa Skills Kit in the Triggers tab. check to make sure the trigger is set to Alexa Skills Kit in the Triggers tab.
  
-----+<color #22b14c>----------------------------------------------------------------------------------------------------------------------------- 
 +</color>
 {{:screen_shot_2016-12-29_at_12.05.13_pm.png|}} {{:screen_shot_2016-12-29_at_12.05.13_pm.png|}}
  
-----+<color #22b14c>----------------------------------------------------------------------------------------------------------------------------- 
 +</color>
  
 -If its not set, click "Add trigger" and choose "Alexa Skills Kit". -If its not set, click "Add trigger" and choose "Alexa Skills Kit".
 +
 +-//If you are following the "Hello World" tutorial, you can continue [[echo_hello_world|here]].//
using_lambda.1483046990.txt.gz · Last modified: by tbrodeur