How to create a Lambda function
Sign in to the AWS Management Console.
Click on the Lambda service.
Select the Northern Virginia region as it contains almost all AWS resources.
Click on the Function appearing on the left side of the console.
Creating a Lambda
The above screen shows that it does not contain any function.
Click on the Create function to create a new function.
Creating a Lambda
From the above screen, we observe that we have three ways of the authoring Lambda
function, i.e., Author from scratch, Blueprints, and AWS Serverless.
Now, we create the Lambda function by using the Author from scratch.
Creating a Lambda
Creating a Lambda
Name: It defines the name of the Lambda function.
Runtime: You can select an appropriate Lambda runtime or create your runtime as a
part of your function deployment package.
Role: You can create a new role. I created a new role, and my role name is
MyLambdaRole.
Policy templates: It defines the Lambda basic execution role. I select a Simple
microservice permission that provides you permission to execute your Lambda
function.
Click on the Create function.
Creating a Lambda
The above screen shows that the function has been successfully created.
You can configure triggers appearing on the left side of the console.
Let's see a scenario of Lambda function by using API Gateway.
Creating a Lambda
A user is browsing in google chrome and sends an HTTP request to API Gateway. An
API Gateway, in turn, triggers the Lambda function, Lambda function then generates
a response and sends back to the API Gateway. API Gateway further sends the
response back to the user.
We know that the Lambda function scales out automatically. If two users are sending
the HTTPS request to the API Gateway, two Lambda functions are invoked that serves
the request individually.
Note: Node.js, python, java, and C# are the languages supported by Lambda.
How is Lambda Priced?
Lambda is priced in the following ways:
Number of Requests: It is priced based on the number of requests. First 1 million
requests are free. $0.20 per 1 million requests thereafter.
Duration: Duration is calculated from the time your code begins executing until it
returns or otherwise terminates rounded up to the nearest 100ms. The price depends
on the amount of money you allocate to your function. You are charged $0.00001667
for every GB-second used.
Why is Lambda cool?
No Servers: You do not need to run your own server, Lambda will do everything for
you. You just need to focus on your code.
Continuous scaling: Lambda will automatically scale up or scale out.
Super super super cheap: It is very cheap as you do not require a server.
Next TopicCloudWatch EC2
← PrevNext →
Youtube For Videos Join Our Youtube Channel: Join Now
Feedback
Send your Feedback to feedback@javatpoint.com
Help Others, Please Share
facebook twitter pinterest
Learn Latest Tutorials
Splunk tutorial
Splunk
SPSS tutorial
SPSS
Swagger tutorial
Swagger
T-SQL tutorial
Transact-SQL
Tumblr tutorial
Tumblr
React tutorial
ReactJS
Regex tutorial
Regex
Reinforcement learning tutorial
Reinforcement Learning
R Programming tutorial
R Programming
RxJS tutorial
RxJS
React Native tutorial
React Native
Python Design Patterns
Python Design Patterns
Python Pillow tutorial
Python Pillow
Python Turtle tutorial
Python Turtle
Keras tutorial
Keras
Preparation
Aptitude
Aptitude
Logical Reasoning
Reasoning
Verbal Ability
Verbal Ability
Interview Questions
Interview Questions
Company Interview Questions
Company Questions
Trending Technologies
Artificial Intelligence Tutorial
Artificial Intelligence
AWS Tutorial
AWS
Selenium tutorial
Selenium
Cloud Computing tutorial
Cloud Computing
Hadoop tutorial
Hadoop
ReactJS Tutorial
ReactJS
Data Science Tutorial
Data Science
Angular 7 Tutorial
Angular 7
Blockchain Tutorial
Blockchain
Git Tutorial
Git
Machine Learning Tutorial
Machine Learning
DevOps Tutorial
DevOps
B.Tech / MCA
DBMS tutorial
DBMS
Data Structures tutorial
Data Structures
DAA tutorial
DAA
Operating System tutorial
Operating System
Computer Network tutorial
Computer Network
Compiler Design tutorial
Compiler Design
Computer Organization and Architecture
Computer Organization
Discrete Mathematics Tutorial
Discrete Mathematics
Ethical Hacking Tutorial
Ethical Hacking
Computer Graphics Tutorial
Computer Graphics
Software Engineering Tutorial
Software Engineering
html tutorial
Web Technology
Cyber Security tutorial
Cyber Security
Automata Tutorial
Automata
C Language tutorial
C Programming
C++ tutorial
C++
Java tutorial
Java
.Net Framework tutorial
.Net
Python tutorial
Python
List of Programs
Programs
Control Systems tutorial
Control System
Data Mining Tutorial
Data Mining
Data Warehouse Tutorial
Data Warehouse
Javatpoint Services