
These can easily catch you off guard if you’re not paying careful attention when setting up your account and calculating your AWS budget.Īdditional charges apply if your AWS Lambda function uses other AWS services and/or transfers data to or from them. While it’s not in-depth as, say, EC2 instance pricing, AWS Lambda still incurs additional costs under certain circumstances that you should be aware of. Note that these are prices for Arm architecture allocation - x86 is slightly more expensive, but for both you get a slightly better deal when allocating more memory.īasically, pay for the extra memory if you can afford it and need it, as it’ll save you money compared to letting a request run for longer on a lower memory band.

In terms of choosing your memory allocation, there are 13 options ranging from 128 MB for $0.0000000017 per 1ms to 10240 MB for $0.0000001333 per 1ms. If you’re using any other languages, all you have to do to migrate to Arm is add a new field in CF/SAM script. Generally speaking, we’d recommend using Arm (it’s faster and cheaper) unless you’re already set up on x86, you’re working in Rust or Golang, and you don’t have the resources to dedicate any extra time to migration. You have the choice of using either x86 or Arm architecture. Your AWS Lambda pricing also depends on the architecture you use and the amount of memory you allocate to your code. This is measured to the nearest millisecond, so it’s all very accurate automatically.
AWS PRICING LAMBDA CODE
In terms of paying for that compute time, it’s calculated from the time your code starts executing to the moment it returns or terminates. Think of it as paying only for the compute time you consume, with a small charge for each request made. You’re paying for your requests as and when they’re carried out, which also means that you aren’t tied into paying for an ongoing amount. The key here is that you’re not reserving a set number of requests to be made, or a number of servers to use. The fewer requests and the less time it takes to execute your code, the less you pay. More specifically, you pay for each request you make and for how long it takes to execute your code.

Put simply, AWS Lambda pricing makes you pay for what you use. That’s why we’re covering the basics in this section, from what exactly you’re paying for when using AWS Lambda to the sneaky extra charges which can take you off-guard. While AWS Lambda pricing isn’t quite the same mind-boggling beast as the rest of AWS, it’s still easy to get lost and miscalculate if you’re not paying careful attention, understand what you’re paying for, and accurately forecast what you’ll be using.
