packages/docs/docs/lambda/estimateprice.mdx
Calculates the AWS costs incurred for AWS Lambda given the region, execution duration and memory size based on the AWS Lambda pricing matrix.
During rendering, many Lambda functions are spawned:
The total duration is the sum of execution duration of all of the above Lambda functions.
This duration can be passed to estimatePrice() to estimate the cost of AWS Lambda.
The calculated duration does not include costs for S3 and Remotion licensing fees.
import { estimatePrice } from "@remotion/lambda";
console.log(
estimatePrice({
region: "us-east-1",
durationInMilliseconds: 20000,
memorySizeInMb: 2048,
diskSizeInMb: 2048,
lambdasInvoked: 1,
})
); // 0.00067
An object containing the following parameters:
regionThe region in which the Lambda function is executed in. Pricing varies across regions.
memorySizeInMbThe amount of memory that has been given to the Lambda function. May be received with getFunctionInfo().
durationInMillisecondsThe estimated total execution duration in Milliseconds of all Lambdas combined. See the top of this page for a guide on how to approximate the duration.
lambdasInvokedThe number of lambdas that were invoked in the rendering process.
diskSizeInMbThe amount of disk space allocated in megabytes.
The estimated cost in USD as a number.