AWS Lambda Documentation
AWS Lambda is a serverless compute service that runs your code in response to events and manages the underlying compute resources for you. These events may include changes in state or an update, such as a user placing an item in a shopping cart on an ecommerce website. You can use AWS Lambda to extend other AWS services with custom logic, or create your own backend services. AWS Lambda runs code in response to multiple events, such as HTTP requests via Amazon API Gateway, modifications to objects in Amazon Simple Storage Service (Amazon S3) buckets, table updates in Amazon DynamoDB, and state transitions in AWS Step Functions.
Lambda runs your code on compute infrastructure and performs the administration of your compute resources. This includes server and operating system maintenance, capacity provisioning and scaling, code and security patch deployment, and code monitoring and logging. All you need to do is supply the code.
Key product features
Extend other AWS services with custom logic
AWS Lambda allows you to add custom logic to AWS resources such as Amazon S3 buckets and Amazon DynamoDB tables, so you can apply compute to data as it enters or moves through the cloud.
To get started with AWS Lambda, first, you create your function by uploading your code (or building it right in the Lambda console) and choosing the memory, timeout period, and AWS Identity and Access Management (IAM) role. Then, you specify the AWS resource to trigger the function, which can be a particular Amazon S3 bucket, Amazon DynamoDB table, or Amazon Kinesis stream. When the resource changes, Lambda will run your function, launching and managing the compute resources as needed to keep up with incoming requests.
Build custom backend services
You can use AWS Lambda to create new backend application services that are triggered using the Lambda application programming interface (API) or custom API endpoints built using Amazon API Gateway. Lambda processes custom events instead of servicing these on the client, helping you avoid client platform variations, reduce battery drain, and enable easier updates.
Bring your own code
Automated administration
AWS Lambda manages the core infrastructure to run your code on highly available, fault-tolerant infrastructure. AWS Lambda deploys your code, handles the administration, maintenance, and security patches, and provides built-in logging and monitoring through Amazon CloudWatch.
Fault tolerance
AWS Lambda maintains compute capacity across multiple Availability Zones (AZs) in each AWS Region to help you protect your code against individual machine or data center facility failures. Both AWS Lambda, and the functions running on the service, provide predictable and reliable operational performance. AWS Lambda is designed to provide high availability for both the service itself and the functions it operates.
Package and deploy functions as container images
AWS Lambda supports function packaging and deploying functions as container images, making it easier for customers to build Lambda-based applications with container image tooling, workflows, and dependencies. You can benefit from Lambda’s operational simplicity, scaling with sub-second startup times, high availability, pay-for-use billing model, and native integrations with many AWS services and software-as-a service (SaaS) applications. Enterprise customers can use a consistent set of tools with both their Lambda and containerized applications.
Scaling
AWS Lambda invokes your code when needed, and scales to support the rate of incoming requests without manual configuration. Lambda performance remains consistent as the event frequency increases. Since your code is stateless, Lambda can start instances as needed.
Connect to relational databases
Use Amazon RDS Proxy to take advantage of managed connection pools for relational databases. RDS Proxy manages thousands of concurrent connections to relational databases, making it easier to build scalable, Lambda-based serverless applications that need to interact with relational databases. You can use RDS Proxy for your serverless applications through the Amazon RDS console or AWS Lambda console.
Control over performance
Provisioned Concurrency gives you greater control over your serverless application performance. When turned on, Provisioned Concurrency keeps functions initialized. Provisioned Concurrency is ideal for applications built using AWS Lambda that need greater control over function start time. You can configure and adjust concurrency your application needs. Scale up, down, or turn it off completely, depending on demand. Take advantage of Provisioned Concurrency for consistent performance for latency-sensitive applications without changing your code or managing compute resources.
Connect to shared file systems
With Amazon Elastic File System (EFS) for AWS Lambda, you can read, write, and persist large volumes of data at low latency, at scale. You don't need to write code to download data to temporary storage in order to process it. This saves time and simplifies the code, so you can focus on your business logic. You can use EFS for Lambda for a range of use cases including processing or backing up large data amounts, and loading large reference files or models. You can also share files between serverless instances or container-based applications, and even run machine learning (ML) inference by using EFS for AWS Lambda.
Run code in response to Amazon CloudFront requests
Orchestrate multiple functions
Build AWS Step Functions workflows to coordinate multiple AWS Lambda functions for complex or long-running tasks. Step Functions lets you define workflows that trigger a collection of Lambda functions using sequential, parallel, branching, and error-handling steps. With Step Functions and Lambda, you can build stateful, long-running processes for applications and backends.
Integrated security model
AWS Lambda's software development kit (SDK) integrates with AWS Identity and Access Management (IAM) to allow your code access to other AWS services. AWS Lambda runs your code within an Amazon Virtual Private Cloud (VPC) by default. Optionally, you can configure AWS Lambda resource access behind your own VPC, in order to leverage custom security groups and network access control lists. This provides Lambda function access to your resources within a VPC. For the latest in Lambda certification and compliance readiness, please see the full services in scope.
Trust and integrity controls
Code Signing for AWS Lambda allows you to verify that unaltered code published by approved developers is deployed in your Lambda functions. You can create digitally signed code artifacts and configure your Lambda functions to verify the signatures at deployment.
Flexible resource model
You choose the amount of memory you want to allocate to your functions, and AWS Lambda allocates proportional CPU power, network bandwidth, and disk input/output (I/O).
Integrate Lambda with your favorite operational tools
AWS Lambda extensions enable integration with monitoring, observability, security, and governance tools. Lambda invokes your function in an execution environment, which provides a runtime where your function code is executed. Lambda extensions run within Lambda’s execution environment, alongside your function code. Lambda extensions can use the AWS Lambda Telemetry API to capture diagnostic information, such as logs, metrics, and traces, directly from Lambda, and send them to a destination of your choice. You can also use extensions to integrate your security agents with Lambda, all with no operational overhead and minimal impact to your function performance.
Additional Information
For additional information about service controls, security features and functionalities, including, as applicable, information about storing, retrieving, modifying, restricting, and deleting data, please see https://docs.aws.amazon.com/index.html. This additional information does not form part of the Documentation for purposes of the AWS Customer Agreement available at http://aws.amazon.com/agreement, or other agreement between you and AWS governing your use of AWS’s services.