SlideShare a Scribd company logo
Introduction to AWS
lambda &
Serverless
Application
Mohammed Shefeeq
• No servers to provision or manage
• Scales with usage
• Pay for value
• Availability and fault tolerance built in
Serverless means …
2
SERVERLESS APPLICATION
• Allows you to build and run applications and services without thinking about servers.
• Also referred to as Function-as-a-Service(FaaS)
• Examples
• Amazon Simple Storage Service(S3)
• AWS Lambda (only be used to execute background tasks)
• Amazon Dynamo DB
• Amazon SNS
Serverless Computing
3
SERVERLESS APPLICATION
LAMBDA
• AWS Lambda is a service which computes the code without any server. It is said
to be serverless compute. The code is executed based on the response of events
in AWS services such as adding/removing files in S3 bucket, updating Amazon
DynamoDB tables, HTTP request from Amazon API Gateway etc.
• AWS Lambda supports languages such as Java, NodeJS, Python, C#, Go, Ruby, and
PowerShell. Note that AWS Lambda will work only with AWS services.
• 128mb – 3gb memory, CPU power is proportional to RAM, you may think that
3GB function is 24 times faster than the 128MB function. But, the 3GB Lambda
does not have 24 CPUs.
• Amazon Lambda enables functions that can run up to 15 minutes. You can now
configure your Amazon Lambda functions to run up to 15 minutes per execution.
Previously, the maximum execution time (timeout) for a Lambda function was 5
minutes.
What is a Lambda
4
LAMBDA
• Lambda function: The foundation, it is comprised of your custom code and any dependent libraries.
• Event source: An AWS service, such as Amazon SNS, or a custom service, that triggers your function and
executes its logic.
• Downstream resources: An AWS service, such DynamoDB tables or Amazon S3 buckets, that your Lambda
function calls once it is triggered.
• Log streams: While Lambda automatically monitors your function invocations and reports metrics to
CloudWatch, you can annotate your function code with custom logging statements that allow you to
analyze the execution flow and performance of your Lambda function to ensure it's working properly.
• AWS SAM: A model to define serverless applications. AWS SAM is natively supported by AWS
CloudFormation and defines simplified syntax for expressing serverless resources
Building Blocks of a Lambda-based Application
5
LAMBDA
There are three key tools that you use to interact with the AWS Lambda service, described below
• Lambda Console: Provides a way for you to graphically design your Lambda-based application,
author or update your Lambda function code, and configure event, downstream resources and
IAM permissions that your function requires.
• AWS CLI: A command-line interface you can use to leverage Lambda's API operations, such as
creating functions and mapping event sources.
• SAM Local: A command-line interface you can use to develop, test, and analyze your serverless
applications locally before uploading them to the Lambda runtime.
Tools to Create and Test Lambda-based Applications
6
LAMBDA FUNCTIONS
Authoring code for
your Lambda function
Uploading code and
creating Lambda
Monitoring and
troubleshooting
Building Lambda Functions
7
Typically, the lifecycle for an AWS Lambda-based application includes
LAMBDA FUNCTIONS
You can author your Lambda function code in the languages that are supported by AWS Lambda.
There are tools for authoring code, such as the AWS Lambda console, Eclipse IDE, and Visual
Studio IDE.
Authoring Code for Your Lambda Function
8
LAMBDA FUNCTIONS
To create a Lambda function, you first package your code and dependencies in a deployment
package. Then, you upload the deployment package to AWS Lambda to create your Lambda
function.
In addition to providing your deployment package, you can provide configuration information
when you create your Lambda function including the compute requirements of your Lambda
function, the name of the handler method in your Lambda function, and the runtime, which
depends on the language you chose to author your code
Uploading code and creating Lambda functions
9
LAMBDA FUNCTIONS
After your Lambda function is in production, AWS Lambda automatically monitors functions on
your behalf, reporting metrics through Amazon CloudWatch.
To help you troubleshoot failures in a function, Lambda logs all requests handled by your function
and also automatically stores logs that your code generates in Amazon CloudWatch Logs.
Monitoring and troubleshooting
10
LAMBDA FUNCTIONS
If your Lambda function is designed to process events of a specific type, you can use sample event
data to test your Lambda function using one of the following methods:
• Test your Lambda function in the console.
• Test your Lambda function using the AWS CLI. You can use the Invoke method to invoke your
Lambda function and pass in sample event data.
• Test your Lambda function locally using SAM Local
Testing Lambda Function
11
AWS SAM
• AWS SAM is a fast and easy way of deploying your serverless applications, allowing you to write
simple templates to describe your functions and their event sources (Amazon API Gateway,
Amazon S3, Kinesis, and so on).
• Based on AWS SAM, SAM Local is an AWS CLI tool that provides an environment for you to
develop, test, and analyze your serverless applications locally before uploading them to the
Lambda runtime. Whether you're developing on Linux, Mac, or Microsoft Windows, you can use
SAM Local to create a local testing environment that simulates the AWS runtime environment.
• Working with SAM Local also allows faster, iterative development of your Lambda function code
because there is no need to redeploy your application package to the AWS Lambda runtime.
SAM Local
12
AWS SAM
1. Install Docker
• Once you have Docker installed, SAM Local automatically provides a customized Docker image
called docker-lambda. This image is designed specifically by an AWS partner to simulate the live
AWS Lambda execution environment. This environment includes installed software, libraries,
security permissions, environment variables, and other features
(Docker is a prerequisite only for testing your application locally and for building deployment packages using the --use-container option. If
you don't plan to use these features initially, you can skip this section or install Docker at a later time.)
2. Install the AWS SAM CLI
• Windows Installer (MSI) files are the package installer files for the Windows operating system.
• Install the AWS SAM CLI 64-bit.
• Verify the installation -
3. Install Git
• To download sample applications using the sam init command, you must also install Git.
Install SAM Local
13
sam --version
AWS SAM
#Step 1 - Download a sample application
#Step 2 - Build your application
#Step 3 - Deploy your application
Deploying a Hello World Application
14
sam init
cd sam-app
sam build
sam deploy --guided
AWS SAM
Step 1: Download a sample AWS SAM application
15
AWS SAM
SAM Project Skeleton
16
Hello-world/
├── README.md
├── .gitignore
├── events/
│ └── event.json
├── hello-world/
│ ├── .npmignore
│ ├── app.js #Contains your AWS Lambda handler logic.
│ └── package.json #Contains any node dependencies the application requires, used for sam build
├── template.yaml #Contains the AWS SAM template defining your application's AWS resources.
└── tests/
└── unit/
└── test-handler.js
AWS SAM
Step 2: Build your application
17
First, change into the project directory, where the template.yaml file for the sample application is
located. (By default, this directory is sam-app.) Then run this command:
sam build
AWS SAM
Step 3: Deploy your application to the AWS Cloud
18
sam deploy --guided
AWS SAM
When you're developing your application, you might find it useful to test locally. The AWS SAM CLI
provides the sam local command to run your application using Docker containers that simulate the
execution environment of Lambda. There are two options to do this:
•Host your API locally
•Invoke your Lambda function directly
Test your application locally
19
sam local start-api
sam local invoke HelloWorldFunction -e events/event.json
THANK YOU

More Related Content

Recently uploaded (20)

PDF
Responsible AI and AI Ethics - By Sylvester Ebhonu
Sylvester Ebhonu
 
PPTX
AI Code Generation Risks (Ramkumar Dilli, CIO, Myridius)
Priyanka Aash
 
PPTX
AI and Robotics for Human Well-being.pptx
JAYMIN SUTHAR
 
PDF
Researching The Best Chat SDK Providers in 2025
Ray Fields
 
PDF
The Future of Artificial Intelligence (AI)
Mukul
 
PDF
Trying to figure out MCP by actually building an app from scratch with open s...
Julien SIMON
 
PDF
OFFOFFBOX™ – A New Era for African Film | Startup Presentation
ambaicciwalkerbrian
 
PDF
RAT Builders - How to Catch Them All [DeepSec 2024]
malmoeb
 
PDF
Economic Impact of Data Centres to the Malaysian Economy
flintglobalapac
 
PDF
How Open Source Changed My Career by abdelrahman ismail
a0m0rajab1
 
PDF
Build with AI and GDG Cloud Bydgoszcz- ADK .pdf
jaroslawgajewski1
 
PPTX
AI in Daily Life: How Artificial Intelligence Helps Us Every Day
vanshrpatil7
 
PPTX
Agile Chennai 18-19 July 2025 Ideathon | AI Powered Microfinance Literacy Gui...
AgileNetwork
 
PDF
Tea4chat - another LLM Project by Kerem Atam
a0m0rajab1
 
PPTX
The Future of AI & Machine Learning.pptx
pritsen4700
 
PPTX
Agile Chennai 18-19 July 2025 | Emerging patterns in Agentic AI by Bharani Su...
AgileNetwork
 
PDF
Peak of Data & AI Encore - Real-Time Insights & Scalable Editing with ArcGIS
Safe Software
 
PPTX
Agentic AI in Healthcare Driving the Next Wave of Digital Transformation
danielle hunter
 
PPTX
Simple and concise overview about Quantum computing..pptx
mughal641
 
PDF
Presentation about Hardware and Software in Computer
snehamodhawadiya
 
Responsible AI and AI Ethics - By Sylvester Ebhonu
Sylvester Ebhonu
 
AI Code Generation Risks (Ramkumar Dilli, CIO, Myridius)
Priyanka Aash
 
AI and Robotics for Human Well-being.pptx
JAYMIN SUTHAR
 
Researching The Best Chat SDK Providers in 2025
Ray Fields
 
The Future of Artificial Intelligence (AI)
Mukul
 
Trying to figure out MCP by actually building an app from scratch with open s...
Julien SIMON
 
OFFOFFBOX™ – A New Era for African Film | Startup Presentation
ambaicciwalkerbrian
 
RAT Builders - How to Catch Them All [DeepSec 2024]
malmoeb
 
Economic Impact of Data Centres to the Malaysian Economy
flintglobalapac
 
How Open Source Changed My Career by abdelrahman ismail
a0m0rajab1
 
Build with AI and GDG Cloud Bydgoszcz- ADK .pdf
jaroslawgajewski1
 
AI in Daily Life: How Artificial Intelligence Helps Us Every Day
vanshrpatil7
 
Agile Chennai 18-19 July 2025 Ideathon | AI Powered Microfinance Literacy Gui...
AgileNetwork
 
Tea4chat - another LLM Project by Kerem Atam
a0m0rajab1
 
The Future of AI & Machine Learning.pptx
pritsen4700
 
Agile Chennai 18-19 July 2025 | Emerging patterns in Agentic AI by Bharani Su...
AgileNetwork
 
Peak of Data & AI Encore - Real-Time Insights & Scalable Editing with ArcGIS
Safe Software
 
Agentic AI in Healthcare Driving the Next Wave of Digital Transformation
danielle hunter
 
Simple and concise overview about Quantum computing..pptx
mughal641
 
Presentation about Hardware and Software in Computer
snehamodhawadiya
 

Featured (20)

PDF
2024 Trend Updates: What Really Works In SEO & Content Marketing
Search Engine Journal
 
PDF
Storytelling For The Web: Integrate Storytelling in your Design Process
Chiara Aliotta
 
PDF
Artificial Intelligence, Data and Competition – SCHREPEL – June 2024 OECD dis...
OECD Directorate for Financial and Enterprise Affairs
 
PDF
How to Leverage AI to Boost Employee Wellness - Lydia Di Francesco - SocialHR...
SocialHRCamp
 
PDF
2024 State of Marketing Report – by Hubspot
Marius Sescu
 
PDF
Everything You Need To Know About ChatGPT
Expeed Software
 
PDF
Product Design Trends in 2024 | Teenage Engineerings
Pixeldarts
 
PDF
How Race, Age and Gender Shape Attitudes Towards Mental Health
ThinkNow
 
PDF
AI Trends in Creative Operations 2024 by Artwork Flow.pdf
marketingartwork
 
PDF
Skeleton Culture Code
Skeleton Technologies
 
PDF
PEPSICO Presentation to CAGNY Conference Feb 2024
Neil Kimberley
 
PDF
Content Methodology: A Best Practices Report (Webinar)
contently
 
PPTX
How to Prepare For a Successful Job Search for 2024
Albert Qian
 
PDF
Social Media Marketing Trends 2024 // The Global Indie Insights
Kurio // The Social Media Age(ncy)
 
PDF
Trends In Paid Search: Navigating The Digital Landscape In 2024
Search Engine Journal
 
PDF
5 Public speaking tips from TED - Visualized summary
SpeakerHub
 
PDF
ChatGPT and the Future of Work - Clark Boyd
Clark Boyd
 
PDF
Getting into the tech field. what next
Tessa Mero
 
PDF
Google's Just Not That Into You: Understanding Core Updates & Search Intent
Lily Ray
 
PDF
How to have difficult conversations
Rajiv Jayarajah, MAppComm, ACC
 
2024 Trend Updates: What Really Works In SEO & Content Marketing
Search Engine Journal
 
Storytelling For The Web: Integrate Storytelling in your Design Process
Chiara Aliotta
 
Artificial Intelligence, Data and Competition – SCHREPEL – June 2024 OECD dis...
OECD Directorate for Financial and Enterprise Affairs
 
How to Leverage AI to Boost Employee Wellness - Lydia Di Francesco - SocialHR...
SocialHRCamp
 
2024 State of Marketing Report – by Hubspot
Marius Sescu
 
Everything You Need To Know About ChatGPT
Expeed Software
 
Product Design Trends in 2024 | Teenage Engineerings
Pixeldarts
 
How Race, Age and Gender Shape Attitudes Towards Mental Health
ThinkNow
 
AI Trends in Creative Operations 2024 by Artwork Flow.pdf
marketingartwork
 
Skeleton Culture Code
Skeleton Technologies
 
PEPSICO Presentation to CAGNY Conference Feb 2024
Neil Kimberley
 
Content Methodology: A Best Practices Report (Webinar)
contently
 
How to Prepare For a Successful Job Search for 2024
Albert Qian
 
Social Media Marketing Trends 2024 // The Global Indie Insights
Kurio // The Social Media Age(ncy)
 
Trends In Paid Search: Navigating The Digital Landscape In 2024
Search Engine Journal
 
5 Public speaking tips from TED - Visualized summary
SpeakerHub
 
ChatGPT and the Future of Work - Clark Boyd
Clark Boyd
 
Getting into the tech field. what next
Tessa Mero
 
Google's Just Not That Into You: Understanding Core Updates & Search Intent
Lily Ray
 
How to have difficult conversations
Rajiv Jayarajah, MAppComm, ACC
 
Ad

Introduction to AWS lambda & Serverless Application1.pptx

  • 1. Introduction to AWS lambda & Serverless Application Mohammed Shefeeq
  • 2. • No servers to provision or manage • Scales with usage • Pay for value • Availability and fault tolerance built in Serverless means … 2 SERVERLESS APPLICATION
  • 3. • Allows you to build and run applications and services without thinking about servers. • Also referred to as Function-as-a-Service(FaaS) • Examples • Amazon Simple Storage Service(S3) • AWS Lambda (only be used to execute background tasks) • Amazon Dynamo DB • Amazon SNS Serverless Computing 3 SERVERLESS APPLICATION
  • 4. LAMBDA • AWS Lambda is a service which computes the code without any server. It is said to be serverless compute. The code is executed based on the response of events in AWS services such as adding/removing files in S3 bucket, updating Amazon DynamoDB tables, HTTP request from Amazon API Gateway etc. • AWS Lambda supports languages such as Java, NodeJS, Python, C#, Go, Ruby, and PowerShell. Note that AWS Lambda will work only with AWS services. • 128mb – 3gb memory, CPU power is proportional to RAM, you may think that 3GB function is 24 times faster than the 128MB function. But, the 3GB Lambda does not have 24 CPUs. • Amazon Lambda enables functions that can run up to 15 minutes. You can now configure your Amazon Lambda functions to run up to 15 minutes per execution. Previously, the maximum execution time (timeout) for a Lambda function was 5 minutes. What is a Lambda 4
  • 5. LAMBDA • Lambda function: The foundation, it is comprised of your custom code and any dependent libraries. • Event source: An AWS service, such as Amazon SNS, or a custom service, that triggers your function and executes its logic. • Downstream resources: An AWS service, such DynamoDB tables or Amazon S3 buckets, that your Lambda function calls once it is triggered. • Log streams: While Lambda automatically monitors your function invocations and reports metrics to CloudWatch, you can annotate your function code with custom logging statements that allow you to analyze the execution flow and performance of your Lambda function to ensure it's working properly. • AWS SAM: A model to define serverless applications. AWS SAM is natively supported by AWS CloudFormation and defines simplified syntax for expressing serverless resources Building Blocks of a Lambda-based Application 5
  • 6. LAMBDA There are three key tools that you use to interact with the AWS Lambda service, described below • Lambda Console: Provides a way for you to graphically design your Lambda-based application, author or update your Lambda function code, and configure event, downstream resources and IAM permissions that your function requires. • AWS CLI: A command-line interface you can use to leverage Lambda's API operations, such as creating functions and mapping event sources. • SAM Local: A command-line interface you can use to develop, test, and analyze your serverless applications locally before uploading them to the Lambda runtime. Tools to Create and Test Lambda-based Applications 6
  • 7. LAMBDA FUNCTIONS Authoring code for your Lambda function Uploading code and creating Lambda Monitoring and troubleshooting Building Lambda Functions 7 Typically, the lifecycle for an AWS Lambda-based application includes
  • 8. LAMBDA FUNCTIONS You can author your Lambda function code in the languages that are supported by AWS Lambda. There are tools for authoring code, such as the AWS Lambda console, Eclipse IDE, and Visual Studio IDE. Authoring Code for Your Lambda Function 8
  • 9. LAMBDA FUNCTIONS To create a Lambda function, you first package your code and dependencies in a deployment package. Then, you upload the deployment package to AWS Lambda to create your Lambda function. In addition to providing your deployment package, you can provide configuration information when you create your Lambda function including the compute requirements of your Lambda function, the name of the handler method in your Lambda function, and the runtime, which depends on the language you chose to author your code Uploading code and creating Lambda functions 9
  • 10. LAMBDA FUNCTIONS After your Lambda function is in production, AWS Lambda automatically monitors functions on your behalf, reporting metrics through Amazon CloudWatch. To help you troubleshoot failures in a function, Lambda logs all requests handled by your function and also automatically stores logs that your code generates in Amazon CloudWatch Logs. Monitoring and troubleshooting 10
  • 11. LAMBDA FUNCTIONS If your Lambda function is designed to process events of a specific type, you can use sample event data to test your Lambda function using one of the following methods: • Test your Lambda function in the console. • Test your Lambda function using the AWS CLI. You can use the Invoke method to invoke your Lambda function and pass in sample event data. • Test your Lambda function locally using SAM Local Testing Lambda Function 11
  • 12. AWS SAM • AWS SAM is a fast and easy way of deploying your serverless applications, allowing you to write simple templates to describe your functions and their event sources (Amazon API Gateway, Amazon S3, Kinesis, and so on). • Based on AWS SAM, SAM Local is an AWS CLI tool that provides an environment for you to develop, test, and analyze your serverless applications locally before uploading them to the Lambda runtime. Whether you're developing on Linux, Mac, or Microsoft Windows, you can use SAM Local to create a local testing environment that simulates the AWS runtime environment. • Working with SAM Local also allows faster, iterative development of your Lambda function code because there is no need to redeploy your application package to the AWS Lambda runtime. SAM Local 12
  • 13. AWS SAM 1. Install Docker • Once you have Docker installed, SAM Local automatically provides a customized Docker image called docker-lambda. This image is designed specifically by an AWS partner to simulate the live AWS Lambda execution environment. This environment includes installed software, libraries, security permissions, environment variables, and other features (Docker is a prerequisite only for testing your application locally and for building deployment packages using the --use-container option. If you don't plan to use these features initially, you can skip this section or install Docker at a later time.) 2. Install the AWS SAM CLI • Windows Installer (MSI) files are the package installer files for the Windows operating system. • Install the AWS SAM CLI 64-bit. • Verify the installation - 3. Install Git • To download sample applications using the sam init command, you must also install Git. Install SAM Local 13 sam --version
  • 14. AWS SAM #Step 1 - Download a sample application #Step 2 - Build your application #Step 3 - Deploy your application Deploying a Hello World Application 14 sam init cd sam-app sam build sam deploy --guided
  • 15. AWS SAM Step 1: Download a sample AWS SAM application 15
  • 16. AWS SAM SAM Project Skeleton 16 Hello-world/ ├── README.md ├── .gitignore ├── events/ │ └── event.json ├── hello-world/ │ ├── .npmignore │ ├── app.js #Contains your AWS Lambda handler logic. │ └── package.json #Contains any node dependencies the application requires, used for sam build ├── template.yaml #Contains the AWS SAM template defining your application's AWS resources. └── tests/ └── unit/ └── test-handler.js
  • 17. AWS SAM Step 2: Build your application 17 First, change into the project directory, where the template.yaml file for the sample application is located. (By default, this directory is sam-app.) Then run this command: sam build
  • 18. AWS SAM Step 3: Deploy your application to the AWS Cloud 18 sam deploy --guided
  • 19. AWS SAM When you're developing your application, you might find it useful to test locally. The AWS SAM CLI provides the sam local command to run your application using Docker containers that simulate the execution environment of Lambda. There are two options to do this: •Host your API locally •Invoke your Lambda function directly Test your application locally 19 sam local start-api sam local invoke HelloWorldFunction -e events/event.json