packages/docs/docs/lambda/speculateFunctionName.mdx
available from v3.3.75
Speculate the name of the Lambda function that will be created by deployFunction() or its CLI equivalent, npx remotion lambda functions deploy. This could be useful in cases when the configuration of the Lambda function is known in advance, and the name of the function is needed.
If you are not sure whether a function exists, use getFunctionInfo() and catch the error that gets thrown if it does not exist.
If you want to get a list of deployed functions, use getFunctions() instead.
A Remotion Lambda function is always names like this:
remotion-render-3-3-63-mem2048mb-disk2048mb-240sec
^^^^^^ ^^^^ ^^^ ^^^
| | | |-- Timeout in seconds
| | |--------- Disk size in MB
| |------------------- Memory size in MB
|----------------------------- Remotion version with dots replaced by dashes
Learn more about this convention.
import {speculateFunctionName} from '@remotion/lambda/client';
const speculatedFunctionName = speculateFunctionName({
memorySizeInMb: 2048,
diskSizeInMb: 2048,
timeoutInSeconds: 120,
});
console.log(speculatedFunctionName); // remotion-render-3-3-63-mem2048mb-disk2048mb-120sec
An object with the following properties:
memorySizeInMbThe amount of memory allocated to the function.
diskSizeInMbThe amount of disk space allocated to the function.
timeoutInSecondsThe timeout that has been assigned to the Lambda function.
A string with the name of the function that will be created.
deployFunction()deployFunction(): npx remotion lambda functions deploy