Serverless Computing, Hands on with AWS-Lambda

Introduction

Introduction to AWS-Lambda

https://aws.amazon.com/lambda/
Basic Diagram for understanding AWS Lambda, Credits: AWS

Writing Your First Lambda Function with Python

Basic Lambda Function Landing Zone
Lambda Function Configuration Page
Test Event Configuration
import jsonprint('Loading function')def lambda_handler(event, context):
key1=event['key1']
key2=event['key2']
sum=int(key1)+int(key2)
difference=int(key1)-int(key2)
multiply=int(key1)*int(key2)
division=int(key1)/int(key2)
return sum,difference,multiply,division
Response structure for the Lambda function

Lambda Functions Automation with Serverless Application Model (SAM) & Github Actions

#Step 1- Build your application
cd sam-app
sam build

#Step 2- Deploy your application
sam deploy --guided
sam deploy --guided output
sam build — use-container
sam local invoke HelloWorldFunction — event events/event.json
sam local start-api
curl http://localhost:3000/
Github Action Workflow Success

Seeing the Results

output from the URL inside API Gateway

More with Serverless using AWS Lambda

--

--

Python, DevOps, Cryptography, Infrastructure Automation. https://syedsaadahmed.com/

Get the Medium app

A button that says 'Download on the App Store', and if clicked it will lead you to the iOS App store
A button that says 'Get it on, Google Play', and if clicked it will lead you to the Google Play store