Back to Browse

3.7 AWS Lambda Function Theory and Lab

309 views
Sep 4, 2020
20:50

Please subscribe the channel to get an update with latest AWS, MicroStrategy videos https://www.youtube.com/channel/UCFwVfgH4aCh6MXAgL0CcIow What is AWS Lambda? AWS Lambda is a compute service that lets you run code without provisioning or managing servers. AWS Lambda executes your code only when needed and scales automatically, from a few requests per day to thousands per second. You pay only for the compute time you consume - there is no charge when your code is not running. With AWS Lambda, you can run code for virtually any type of application or backend service - all with zero administration. AWS Lambda runs your code on a high-availability compute infrastructure and performs all of the administration of the compute resources, including server and operating system maintenance, capacity provisioning and automatic scaling, code monitoring, and logging. Step by Step guide to run code in Lambda:- Step 1: Enter the Lambda Console When you click here, the AWS Management Console will open in a new browser window, so you can keep this step-by-step guide open. Find Lambda under Compute and click to open the AWS Lambda Console. Step 2: Select a Lambda Blueprint Blueprints provide example code to do some minimal processing. Most blueprints process events from specific event sources, such as Amazon S3, DynamoDB, or a custom application. a. In the AWS Lambda console, select Create a Function. b. Select Blueprints. c. In the Filter box, type in hello-world-python and select the hello-world-python blueprint. d. Then click Configure. Step 3: Configure and Create Your Lambda Function A Lambda function consists of code you provide, associated dependencies, and configuration. The configuration information you provide includes the compute resources you want to allocate (for example, memory), execution timeout, and an IAM role that AWS Lambda can assume to execute your Lambda function on your behalf. a. You will now enter Basic Information about your Lambda function. b. Go to the bottom of the page and select Create Function. c. Runtime: Currently, you can author your Lambda function code in Java, Node.js, C#, Go or Python. For this tutorial, leave this on Python 2.7 as the runtime. d. Handler: You can specify a handler (a method/function in your code) where AWS Lambda can begin executing your code. e. Scroll down to configure your memory, timeout, and VPC settings. For this tutorial, leave the default Lambda function configuration values. Step 4: Invoke Lambda Function and Verify Results The console shows the hello-world-python Lambda function - you can now test the function, verify results, and review the logs. b. The editor pops up to enter an event to test your function. c. Select Test. d. Upon successful execution, view the results in the console: The Execution results section verifies that the execution succeeded. The Summary section shows the key information reported in the Log output. The Log output section will show the logs generated by the Lambda function execution. Choose Hello World from the Sample event template list from the Input test event page. Type in an event name like HelloWorldEvent. You can change the values in the sample JSON, but don’t change the event structure. For this tutorial, replace value1 with hello, world!. Select Create. a. Select Configure Test Event from the drop-down menu called "Select a test event..."

Download

0 formats

No download links available.

3.7 AWS Lambda Function Theory and Lab | NatokHD