With AWS Lambda, you pay only for what you use. You are charged based on the number of requests for your functions and the duration, the time it takes for your code to execute.
Lambda counts a request each time it starts executing in response to an event notification or invoke call, including test invokes from the console.
Duration is calculated from the time your code begins executing until it returns or otherwise terminates, rounded up to the nearest 1ms*. The price depends on the amount of memory you allocate to your function. In the AWS Lambda resource model, you choose the amount of memory you want for your function, and are allocated proportional CPU power and other resources. An increase in memory size triggers an equivalent increase in CPU available to your function. To learn more, see the Function Configuration documentation.
The AWS Lambda free usage tier includes 1M free requests per month and 400,000 GB-seconds of compute time per month.
AWS Lambda participates in Compute Savings Plans, a flexible pricing model that offers low prices on EC2, Fargate, and Lambda usage, in exchange for a commitment to a consistent amount of usage (measured in $/hour) for a 1 or 3 year term. With Compute Savings Plans you can save up to 17% on AWS Lambda. Savings apply to Duration, Provisioned Concurrency, and Duration (Provisioned Concurrency). Learn more »
AWS Lambda Pricing
The price for Duration depends on the amount of memory you allocate to your function. You can allocate any amount of memory to your function between 128MB and 10,240MB, in 1MB increments. The table below contains a few examples of the price per 1ms associated with different memory sizes.
All examples below are based on price in US East (N. Virginia).
-
Example 1
If you allocated 512MB of memory to your function, executed it 3 million times in one month, and it ran for 1 second each time, your charges would be calculated as follows:If you allocated 512MB of memory to your function, executed it 3 million times in one month, and it ran for 1 second each time, your charges would be calculated as follows:Monthly compute charges
The monthly compute price is $0.00001667 per GB-s and the free tier provides 400,000 GB-s.
Total compute (seconds) = 3M * (1s) = 3,000,000 seconds
Total compute (GB-s) = 3,000,000 * 512MB/1024 = 1,500,000 GB-s
Total compute – Free tier compute = Monthly billable compute GB- s
1,500,000 GB-s – 400,000 free tier GB-s = 1,100,000 GB-s
Monthly compute charges = 1,100,000 * $0.00001667 = $18.34
Monthly request charges
The monthly request price is $0.20 per 1 million requests and the free tier provides 1M requests per month.
Total requests – Free tier requests = Monthly billable requests
3M requests – 1M free tier requests = 2M Monthly billable requests
Monthly request charges = 2M * $0.2/M = $0.40
Total monthly charges
Total charges = Compute charges + Request charges = $18.34 + $0.40 = $18.74 per month
-
Example 2
If you allocated 128MB of memory to your function, executed it 30 million times in one month, and it ran for 200ms each time, your charges would be calculated as follows:If you allocated 128MB of memory to your function, executed it 30 million times in one month, and it ran for 200ms each time, your charges would be calculated as follows:Monthly compute charges
The monthly compute price is $0.00001667 per GB-s and the free tier provides 400,000 GB-s.
Total compute (seconds) = 30M * (0.2sec) = 6,000,000 seconds
Total compute (GB-s) = 6,000,000 * 128MB/1024 = 750,000 GB-s
Total Compute – Free tier compute = Monthly billable compute seconds
750,000 GB-s – 400,000 free tier GB-s = 350,000 GB-s
Monthly compute charges = 350,000 * $0.00001667 = $5.83
Monthly request charges
The monthly request price is $0.20 per 1 million requests and the free tier provides 1M requests per month.
Total requests – Free tier request = Monthly billable requests
30M requests – 1M free tier requests = 29M Monthly billable requests
Monthly request charges = 29M * $0.2/M = $5.80
Total compute charges
Total charges = Compute charges + Request charges = $5.83 + $5.80 = $11.63 per month
-
Example 3
This example shows how charges are calculated when you are running functions with different memory sizes. For the example, let’s assume you have three functions, each with different memory sizes as described below:This example shows how charges are calculated when you are running functions with different memory sizes. For the example, let’s assume you have three functions, each with different memory sizes as described below:Function 1
128MB of memory, executed 25M times in one month, runs for 200ms each time
Total compute (seconds) = 25M * (0.2sec) = 5M seconds
Function 2
448MB of memory, executed 5M times in one month, runs for 500ms each time
Total compute (seconds) = 5M * (0.5sec) = 2M seconds
Function 3
1024MB of memory, executed 2.5M times in one month, runs for 1 second each time
Total compute (seconds) = 2.5M * (1sec) = 2.5M seconds
If you ran these functions, your charges would be calculated as follows:
Monthly compute charges
AWS Lambda normalizes the total compute time to GB-s and then sums the total across all functions
Function 1 (GB-S) = 5M seconds * (128MB/1024) = 625,000 GB-s
Function 2 (GB-S) = 2.5M seconds * (448MB/1024) = 1,093,750 GB-s
Function 3 (GB-S) = 2.5M seconds * (1024MB/1024) = 2,500,000 GB-s
Total monthly compute usage (GB-S) = 4,218,750 GB-s
The monthly compute price is $0.00001667 per GB-s and the free tier provides 400,000 GB-s.
Monthly charged compute usage = Total monthly compute usage – Free tier usage
Monthly charged compute usage = 4,218,750 – 400,000 = 3,818,750 GB-s
Monthly compute charges = 3,818,750 * 0.00001667 = $63.66
Monthly request charges
The monthly request price is $0.20 per 1 million requests and the free tier provides 1M requests per month.
Total requests – Free tier requests = Monthly billable requests
(25M+5M+2.5M) requests – 1M free tier requests = 31.5M Monthly billable requests
Monthly request charges = 31.5M * $0.2/M = $6.30
Total Monthly Charges
Total charges = Compute charges + Request charges = $63.66 + $6.30 = $69.96 per month
* Duration charges apply to code that runs in the handler of a function as well as initialization code that is declared outside of the handler. For more details, see the Lambda Programming Model documentation.
Provisioned Concurrency Pricing
You can enable Provisioned Concurrency for your Lambda functions for greater control over the performance of your serverless applications. When enabled, Provisioned Concurrency keeps functions initialized and hyper-ready to respond in double-digit milliseconds. You pay for the amount of concurrency that you configure and for the period of time that you configure it. When Provisioned Concurrency is enabled for your function and you execute it, you also pay for Requests and Duration based on the prices below. If the concurrency for your function exceeds the configured concurrency, you will be billed for executing the excess functions at the rate outlined in the AWS Lambda Pricing section above. To learn more about Provisioned Concurrency, visit the documentation.
Provisioned Concurrency is calculated from the time you enable it on your function until it is disabled, rounded up to the nearest 5 minutes. The price depends on the amount of memory you allocate to your function and the amount of concurrency that you configure on it.
Duration is calculated from the time your code begins executing until it returns or otherwise terminates, rounded up to the nearest 1ms**. The price depends on the amount of memory you allocate to your function.
The Lambda free tier does not apply to functions that have Provisioned Concurrency enabled. If you enable Provisioned Concurrency for your function and execute it, you will be charged for Requests and Duration based on the price below.
All examples below are based on price in US East (N. Virginia).
-
Example 1
Let’s assume you allocated 1024MB to your function and enabled Provisioned Concurrency on it for 2 hours. The concurrency that you configured was 1,000. You executed the function 1.2M times during the 2 hours and it ran for 1 second each time. Your charges would be calculated as follows:Let’s assume you allocated 1024MB to your function and enabled Provisioned Concurrency on it for 2 hours. The concurrency that you configured was 1,000. You executed the function 1.2M times during the 2 hours and it ran for 1 second each time. Your charges would be calculated as follows:Provisioned Concurrency charges
The Provisioned Concurrency price is $0.000004167 per GB-s
Total period of time for which Provisioned Concurrency is enabled (seconds) = 2 hours = 7,200 seconds
Total concurrency configured (GB): 1000 * 1024MB/1024MB = 1000 GB
Total Provisioned Concurrency amount (GB-s) = 1000 GB * 7,200 seconds = 7.2M GB-s
Provisioned Concurrency charges = 7.2M GB-s * $0.000004167 = $30
Request charges
The monthly request price is $0.20 per 1 million requests.
Monthly request charges = 1.2M * $0.20/M = $0.24
Compute charges
The compute price is $0.000009722 per GB-s
Total compute duration (seconds) = 1.2M * 1 second = 1.2M seconds
Total compute (GB-s) = 1.2M seconds * 1024MB / 1024MB = 1.2M GB-s.
Total compute charges = 1.2M GB-s * $0.000009722 = $11.67
Total charges
Total charges = Provisioned Concurrency charges + Request charges + Compute charges
Total charges = $30 + $0.24 + $11.67 = $41.91
-
Example 2
Let’s assume you allocated 256 MB of memory to your function and enabled Provisioned Concurrency on it for 31 days. The concurrency that you configured was 100. You executed the function 100 million times during the 31 days and the function ran for 1 second each time. Your charges would be calculated as follows:Let’s assume you allocated 256 MB of memory to your function and enabled Provisioned Concurrency on it for 31 days. The concurrency that you configured was 100. You executed the function 100 million times during the 31 days and the function ran for 1 second each time. Your charges would be calculated as follows:Provisioned Concurrency charges
The Provisioned Concurrency price is $0.000004167 per GB-s
Total period of time for which Provisioned Concurrency is enabled (seconds) = 31 * 24 * 3600 seconds = 2,678,400 seconds
Total concurrency configured (GB): 100 * 256MB/1024MB = 25 GB
Total Provisioned Concurrency amount (GB-s) = 25 GB * 2,678,400 seconds = 66,960,000 GB-s
Monthly Provisioned Concurrency charges = 66,960,000 * $0.000004167 = $279.02
Monthly request charges
The monthly request price is $0.20 per 1 million requests.
Monthly request charges = 100M requests * $0.20/M = $20.00
Monthly compute charges
The monthly compute price is $0.000009722 per GB-s
Total compute (seconds) = 100M * 1 second = 100M seconds
Total compute (GB-s) = 100M seconds * 256MB/1024 = 25M GB-s
Monthly compute charges = 25M GB-s * $0.000009722 = $243.05
Total charges
Total charges = Provisioned Concurrency charges + Request charges + Compute charges
Total charges = $279.02 + $20.00 + $243.05 = $542.07
-
Example 3
Let’s assume you allocated 256 MB of memory to your function and enabled Provisioned Concurrency on it for four hours every day. The concurrency that you configured was 100. You executed the function 100 million times during one month and the function ran for 1 second each time. 30 million of those executions happened while Provisioned Concurrency was enabled and 70 million executions happened while Provisioned Concurrency was disabled. Your charges would be calculated as follows:Let’s assume you allocated 256 MB of memory to your function and enabled Provisioned Concurrency on it for four hours every day. The concurrency that you configured was 100. You executed the function 100 million times during one month and the function ran for 1 second each time. 30 million of those executions happened while Provisioned Concurrency was enabled and 70 million executions happened while Provisioned Concurrency was disabled. Your charges would be calculated as follows:Provisioned Concurrency charges
The Provisioned Concurrency price is $0.000004167 per GB-s
Total period of time for which Provisioned Concurrency is enabled (seconds) = 31 * 4 * 3600 seconds = 446,400 seconds
Total concurrency configured (GB): 100 * 256MB/1024MB = 25 GB
Total Provisioned Concurrency amount (GB-s) = 25 GB * 446,400 = 11,160,000 GB-s
Monthly Provisioned Concurrency charges = 11,160,000 * $0.000004167 = $46.50
Monthly request charges when Provisioned Concurrency is enabled
The monthly request price is $0.20 per 1 million requests.
Monthly request charges = 30M requests * $0.20 = $6.00
Monthly compute charges when Provisioned Concurrency is enabled
The monthly compute price is $0.000009722 per GB-s
Total compute (seconds) = 30M * 1 second = 30M seconds
Total compute (GB-s) = 30M * 256MB/1024 = 7.5M GB-s
Monthly compute charges = 7.5M * $0.000009722 = $72.92
Let's now calculate the charges for the function when Provisioned Concurrency is NOT enabled.
Monthly request charges
The monthly request price is $0.20 per 1 million requests and the free tier provides 1M requests.
Total requests – Free tier requests = Monthly billable requests
70M requests – 1M free tier requests = 69M Monthly billable requests
Monthly request charges = 69M * $0.20/M = $13.8
Monthly compute charges
The monthly compute price is $0.00001667 per GB-s and the free tier provides 400,000 GB-s.
Total compute (seconds) = 70M * 1 second = 70M seconds
Total compute (GB-s) = 70M * 256MB/1024MB = 17.5M GB-s
Total compute – Free tier compute = Monthly billable compute GB- s
17.5M GB-s – 400,000 free tier GB-s = 17.1M GB-s
Monthly compute charges = 17.1M GB-s * $0.00001667 = $285.06
Total charges
Total charges = Provisioned Concurrency charges + Total Request charges + Total Compute charges
Total charges = $46.50 + ($6.00 + $13.8) + ($72.92 + $285.06) = $424.28
-
Example 4
Let’s assume you allocated 1024MB to your function and enabled Provisioned Concurrency on it for two hours. The concurrency that you configured was 1,000. Due to a burst in demand, the function reached a concurrency level of 1,200 several times during these two hours. For the remainder of the time, the concurrency stayed under 1,000. You executed the function 1.2M times during the two hours and it ran for 1 second each time. Of the 1.2M executions, 1M used Provisioned Concurrency and 200,000 did not. Let’s also assume that you have already used up all available requests and duration included in the free usage tier. Your charges would be calculated as follows:Let’s assume you allocated 1024MB to your function and enabled Provisioned Concurrency on it for two hours. The concurrency that you configured was 1,000. Due to a burst in demand, the function reached a concurrency level of 1,200 several times during these two hours. For the remainder of the time, the concurrency stayed under 1,000. You executed the function 1.2M times during the two hours and it ran for 1 second each time. Of the 1.2M executions, 1M used Provisioned Concurrency and 200,000 did not. Let’s also assume that you have already used up all available requests and duration included in the free usage tier. Your charges would be calculated as follows:Provisioned Concurrency charges
The Provisioned Concurrency price is $0.000004167 per GB-s
Total period of time for which Provisioned Concurrency is enabled (seconds) = 2 hours = 7,200 seconds
Total concurrency configured (GB): 1000 * 1024MB/1024MB = 1000 GB
Total Provisioned Concurrency amount (GB-s) = 1000 GB * 7,200 seconds = 7.2M GB-s
Provisioned Concurrency charges = 7.2M * $0.000004167 = $30
Request charges for Provisioned Concurrency when usage is under 1,000 concurrency
The monthly request price is $0.20 per 1 million requests.
Monthly request charges = 1M * $0.20 /M = $0.20
Compute charges for Provisioned Concurrency when usage is under 1,000 concurrency
The compute price is $0.000009722 per GB-s
Total compute duration (seconds) = 1M * 1 second = 1M seconds
Total compute (GB-s) = 1M seconds * 1024MB / 1024MB = 1M GB-s.
Total compute charges = 1M GB-s * $0.000009722 = $9.72
Monthly request charges for requests over the 1,000 concurrency level
The monthly request price is $0.20 per 1 million requests.
Monthly request charges = (1.2M – 1M) * $0.20 / M = $0.04
Monthly compute charges for compute over the 1,000 concurrency level
The monthly compute price is $0.00001667 per GB-s.
Total compute (seconds) = 200,000 * 1 second = 200,000 seconds
Total compute (GB-s) = 200,000 seconds * 1024MB/1024MB = 200,000 GB-s
Monthly compute charges = 200,000 GB-s * $0.00001667 = $3.33
Total charges
Total charges = Provisioned Concurrency charges + Total Request charges + Total Compute charges
Total charges = $30 + ($0.20 + $0.04) + ($9.72 + $3.33) = $43.29
** Duration charges apply to code that runs in the handler of a function as well as initialization code that is declared outside of the handler. For functions configured with Provisioned Concurrency, AWS Lambda periodically recycles the execution environments and re-runs your initialization code. For more details, see the Lambda Programming Model documentation.
Data Transfer & Other Charges
Data Transfer
Data transferred “in” to and “out” of your AWS Lambda functions from outside the region the function executed in will be charged at the EC2 data transfer rates as listed here under “Data transfer”.
Data transferred between Amazon S3, Amazon Glacier, Amazon DynamoDB, Amazon SES, Amazon SQS, Amazon Kinesis, Amazon ECR, Amazon SNS, Amazon EFS, or Amazon SimpleDB and AWS Lambda functions in the same AWS Region is free. The usage of VPC or VPC peering with AWS Lambda functions will incur additional charges as explained here.
For details on AWS service pricing, see the pricing section of the relevant AWS service detail pages.
Calculator
Lambda@Edge Pricing
Lambda@Edge functions are metered at a granularity of 50ms
Lambda@Edge Pricing Examples
-
Example 1
If your Lambda@Edge function executed 10 million times in one month, and it ran for 50ms each time, your charges would be calculated as follows:If your Lambda@Edge function executed 10 million times in one month, and it ran for 50ms each time, your charges would be calculated as follows:Monthly compute charges
The monthly compute price is $0.00000625125 per 128MB-second
Total compute (seconds) = 10M * (0.05sec) = 500,000 secondsMonthly compute charges = 500,000 * $0.00000625125 = $3.13
Monthly request chargesThe monthly request price is $0.60 per 1 million requests.
Monthly request charges = 10M * $0.6/M = $6.00
Total monthly charges
Total charges = Compute charges + Request charges = $3.13 + $6.00 = $9.13 per month
Additional pricing resources
Easily calculate your monthly costs with AWS
Additional resources for switching to AWS