What is AWS Lambda?
AWS Lambda is a compute service that runs code without the need to manage servers. Your code runs, scaling up and down automatically, with pay-per-use pricing. To get started, see Create your first function.
You can use Lambda for:
-
Stream processing: Process real-time data streams for analytics and monitoring. See Kinesis Data Streams for details.
-
Web applications: Build scalable web apps that automatically adjust to demand.
-
Mobile backends: Create secure API backends for mobile and web applications.
-
IoT backends: Handle web, mobile, IoT, and third-party API requests. See IoT for details.
-
File processing: Process files automatically when uploaded to Amazon Simple Storage Service. See file processing examples for details.
-
Database operations and integration examples: Respond to database changes and automate data workflows. See database examples for details.
-
Scheduled and periodic tasks: Run automated operations on a regular schedule using EventBridge. See scheduled task examples for details.
For pricing information, see AWS Lambda Pricing
How Lambda works
When using Lambda, you are responsible only for your code. Lambda runs your code on a high-availability compute infrastructure and manages all the computing resources, including server and operating system maintenance, capacity provisioning, automatic scaling, and logging.
Because Lambda is a serverless, event-driven compute service, it uses a different programming paradigm than traditional web applications. The following model illustrates how Lambda works:
-
You write and organize your code in Lambda functions, which are the basic building blocks you use to create a Lambda application.
-
You control security and access through Lambda permissions, using execution roles to manage what AWS services your functions can interact with and what resource policies can interact with your code.
-
Event sources and AWS services trigger your Lambda functions, passing event data in JSON format, which your functions process (this includes event source mappings).
-
Lambda runs your code with language-specific runtimes (like Node.js and Python) in execution environments that package your runtime, layers, and extensions.
Tip
To learn how to build serverless solutions, check out the Serverless Developer Guide.
Key features
Configure, control, and deploy secure applications:
-
Environment variables modify application behavior without new code deployments.
-
Versions safely test new features while maintaining stable production environments.
-
Lambda layers optimize code reuse and maintenance by sharing common components across multiple functions.
-
Code signing enforce security compliance by ensuring only approved code reaches production systems.
Scale and perform reliably:
-
Concurrency and scaling controls precisely manage application responsiveness and resource utilization during traffic spikes.
-
Lambda SnapStart significantly reduce cold start times. Lambda SnapStart can provide as low as sub-second startup performance, typically with no changes to your function code.
-
Response streaming optimize function performance by delivering large payloads incrementally for real-time processing.
-
Container images package functions with complex dependencies using container workflows.
Connect and integrate seamlessly:
-
VPC networks secure sensitive resources and internal services.
-
File system integration that shares persistent data and manage stateful operations across function invocations.
-
Function URLs create public-facing APIs and endpoints without additional services.
-
Lambda extensions augment functions with monitoring, security, and operational tools.
Related information
For information on how Lambda works, see How Lambda works.
To start using Lambda, see Create your first Lambda function.
For a list of example applications, see Getting started with example applications and patterns.
Javascript is disabled or is unavailable in your browser.
To use the Amazon Web Services Documentation, Javascript must be enabled. Please refer to your browser's Help pages for instructions.