With AWS Lambda, you pay only for what you use. You are charged based on the number of requests for your functions and the time your code executes.
AWS Lambda is now generally available
Try AWS Lambda for FreeThe AWS Free Tier includes 1 million free requests and up to 3.2 million seconds of compute time per month with AWS Lambda.
The Lambda free tier includes 1M free requests per month and 400,000 GB-seconds of compute time per month.
You are charged for the total number of requests across all your functions. Lambda counts a request each time it starts executing in response to an event notification or invoke call, including test invokes from the console.
- First 1 million requests per month are free
- $0.20 per 1 million requests thereafter ($0.0000002 per request)
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 memory you allocate to your function. You are charged $0.00001667 for every GB-second used.
The Lambda free tier includes 1M free requests per month and 400,000 GB-seconds of compute time per month. The memory size you choose for your Lambda functions determines how long they can run in the free tier. The Lambda free tier does not automatically expire at the end of your 12 month AWS Free Tier term, but is available to both existing and new AWS customers indefinitely.
The table below shows the free tier seconds and the approximate price per 100ms associated for different memory sizes.
| Memory (MB) | Free tier seconds per month | Price per 100ms ($) |
| 128 | 3,200,000 | 0.000000208 |
| 192 | 2,133,333 | 0.000000313 |
| 256 | 1,600,000 | 0.000000417 |
| 320 | 1,280,000 | 0.000000521 |
| 384 | 1,066,667 | 0.000000625 |
| 448 | 914,286 | 0.000000729 |
| 512 | 800,000 | 0.000000834 |
| 576 | 711,111 | 0.000000938 |
| 640 | 640,000 | 0.000001042 |
| 704 | 581,818 | 0.000001146 |
| 768 | 533,333 | 0.000001250 |
| 832 | 492,308 | 0.000001354 |
| 896 | 457,143 | 0.000001459 |
| 960 | 426,667 | 0.000001563 |
| 1024 | 400,000 | 0.000001667 |
| 1088 | 376,471 | 0.000001771 |
| 1152 | 355,556 | 0.000001875 |
| 1216 | 336,842 | 0.000001980 |
| 1280 | 320,000 | 0.000002084 |
| 1344 | 304,762 |
0.000002188 |
| 1408 | 290,909 |
0.000002292 |
| 1472 | 278,261 | 0.000002396 |
| 1536 | 266,667 | 0.000002501 |
You may incur additional charges if your Lambda function utilizes other AWS services or transfers data. For example, if your Lambda function reads and writes data to or from Amazon S3, you will be billed for the read/write requests and the data stored in Amazon S3.
For details on AWS service pricing, see the pricing section of the relevant AWS service detail pages. Links to pricing for some of the commonly used services are listed below.
Data transfer (If your Lambda function initiates external data transfers, they will be charged at the EC2 data transfer rate)
Amazon S3 pricing (includes pricing for storage, requests, and data transfer)
Amazon DynamoDB (includes pricing for data storage, throughput capacity, and data transfer)
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
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
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
There is no free tier for Lambda@Edge at this time.
You are charged for the total number of requests across all your functions. Lambda@Edge counts a request each time it starts executing in response to a CloudFront event at any global edge location.
Request pricing is $0.60 per 1 million requests ($0.0000006 per request).
Duration is calculated from the time your code begins executing at an edge location until it returns or otherwise terminates. You are charged $0.00005001 for every GB-second used. Lambda@Edge functions will have 128MB of memory available per execution, so the duration charge is $0.00000625125 for every 128MB-second used. Note that Lambda@Edge functions are metered at a granularity of 50ms.
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 seconds
Monthly compute charges = 500,000 * $0.00000625125 = $3.13
Monthly request charges
The 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