Going Serverless with AWS Lambda

Reading Time: 3 minutes

Gone are the days of EC2. Its time to go Lambda…..

Introduced in 2014, as a part of Amazon Web Services, Lambda is an event driven computing service that runs your code in response to an event.

In simpler words, you can write your code snippet on Lambda and direct it to run whenever an event occurs. So, you can run your code without a need to manage servers. The best part of using AWS Lambda is that you pay only when your code is running. Yeah, it’s pocket-friendly too !!

What is Lambda ?

Writing your first Lambda Code

Following the tradition, we will be writing a simple “Hello World” program in Lambda and testing it from the console.

Step 1: Starting the Lambda Console

Step 2: Click on Create a function

Step 3: Select Blueprints, type hello in search box and press Enter

Step 4: Select hello-world-python function

Step 4: Enter name of the function and select Role as an existing or make a new role as per your need

Step 5: Scroll down the page and click on Create Function

Step 6: You will get successful function creation message and the function can be seen by scrolling down the page

Step 7: Now click on the Test to test the function created

Step 8: Select Event Template as Hello World and Event Name as MyTestEvent, Scroll down and click on Create Event

Step 9: Click on Test and scroll down to see the response as Hello World

Congratulations on running and testing your first Lambda function

Next time we will cover some complex function which involves AWS S3 Bucket operations with Lambda functions.