AWS Lambda is a compute service that runs your code in response to events and automatically manages the compute resources for you, making it easy to build applications that respond quickly to new information. AWS Lambda starts running your code within milliseconds of an event such as an image upload, in-app activity, website click, or output from a connected device. You can also use AWS Lambda to create new back-end services where compute resources are automatically triggered based on custom requests. With AWS Lambda you pay only for the requests served and the compute time required to run your code. Billing is metered in increments of 100 milliseconds, making it cost-effective and easy to scale automatically from a few requests per day to thousands per second.
The AWS Lambda Preview is available now
Sign up for the PreviewIntroducing the AWS Compute Blog. Read the latest about AWS Lambda, other AWS compute services, and new trends in cloud computing.
AWS Lambda makes it easy for you to build applications that respond quickly to new information. For example, you can trigger an AWS Lambda function to automatically create a thumbnail when an image is uploaded to Amazon S3, verify address updates in an Amazon DynamoDB table, or process click-stream data in an Amazon Kinesis stream, without having to manage any compute infrastructure.
AWS Lambda typically runs your code within milliseconds of an event. The service automatically manages the compute capacity for you and spins up the necessary infrastructure, deploys your code, and runs it for each event. Each event is processed individually so thousands of functions can run in parallel and performance remains consistently high regardless of the frequency of events.
AWS Lambda automatically runs your code on high availability compute infrastructure and performs all the administration of the underlying compute resources, including server and operating system maintenance, capacity provisioning and automatic scaling, code and security patch deployment, and monitoring and logging. All you need to do is write the code.
AWS Lambda runs your code only when needed, with no unnecessary cost. With AWS Lambda you don’t need to build out and maintain a fleet of servers and then pay for the time they sit and wait for their jobs to run. Instead, AWS Lambda charges a low fee per request and for the time your code runs, making it cost effective to build solutions that scale from one request per month to thousands per second.
The code you run on AWS Lambda is called a “Lambda function.” After you create your Lambda function it is always ready to run as soon as it is triggered, similar to a formula in a spreadsheet. Each function includes your code as well as some associated configuration information, including the function name and resource requirements. Lambda functions are “stateless,” with no affinity to the underlying infrastructure, so that Lambda can rapidly launch as many copies of the function as needed to scale to the rate of incoming events.
After you upload your code to AWS Lambda, you can associate your function with specific AWS resources (e.g. a particular Amazon S3 bucket, Amazon DynamoDB table, or Amazon Kinesis stream). Then, when the resource changes, Lambda will execute your function and manage the compute resources as needed in order to keep up with incoming requests.
AWS Lambda can trigger compute functions such as creating thumbnails when new images are added to Amazon S3, running sophisticated calculations on data after it is loaded into Amazon DynamoDB, or perform watermarking or compression when new documents are uploaded to Amazon S3.
AWS Lambda functions can be triggered by data stream updates from Amazon Kinesis and Amazon DynamoDB. For instance, you can watch for a pattern, such as an address, and trigger an alert.
AWS Lambda makes it easy to build back-end services to perform workloads such as image analysis, document transformation, and indexing. This enables you to architect your applications more effectively by moving client-side logic to a Lambda function so that you can avoid client platform variations, reduce battery drain, and enable easier updates.
AWS Lambda functions can be triggered by external event timers, so functions can be run during regularly scheduled maintenance times or non-peak hours. For example, you can trigger an AWS Lambda function to perform nightly archive cleanups during non-busy hours.
Many developers store objects in Amazon S3 while using Amazon DynamoDB to store and index the object metadata and enable high speed search. AWS Lambda makes it easy to keep everything in sync by running a function to automatically update the index in Amazon DynamoDB every time objects are added or updated from Amazon S3.
AWS Lambda makes it simple to track log files and audit records, whether they arrive as Amazon S3 objects, Amazon DynamoDB table updates, or Kinesis stream records. AWS Lambda allows you to run code to automatically scan for changes, detect anomalies, and send notifications through Amazon SNS or other means when a problem is detected.
AWS Lambda functions can be triggered by events from connected devices like weather sensors or house alarms. For example, you could create an AWS Lambda function that sends a customized Amazon SNS notification when a smart thermostat indicates that the temperature is outside a defined limit. You could also create a Lambda function to monitor and act on device data in an Amazon Kinesis stream, enabling you to easily connect smart appliances, home lighting systems, connected parking meters, or industrial machines to AWS services.