Function naming convention
A Remotion Lambda function has the following naming convention:
remotion-render-4-0-140-mem2048mb-disk2048mb-240sec^^^^^^^ ^^^^ ^^^^ ^^^| | | |-- Timeout in seconds| | |--------- Disk size in MB| |------------------- Memory size in MB|----------------------------- Remotion version with dots replaced by dashes
remotion-render-4-0-140-mem2048mb-disk2048mb-240sec^^^^^^^ ^^^^ ^^^^ ^^^| | | |-- Timeout in seconds| | |--------- Disk size in MB| |------------------- Memory size in MB|----------------------------- Remotion version with dots replaced by dashes
When you deploy a function, the name is hardcoded. This has two functions:
speculateFunctionName()
so you don't have to fetch a list of functions in your AWS account.Why can't I rename the function?
- The
npx remotion lambda render
command looks for functions that match this convention. - With the default user policy, Remotion Lambda restricts itself from accessing functions that don't match this convention.
- You can use the
speculateFunctionName()
function save one API call. - The function is more likely to be warm from a previous invocation if you only have 1 function with the same configuration.
- There is no benefit to renaming the function.
What if I want to have two functions for two different projects?
A function is not tied to a project.
Each function is a binary that contains the same code.
Every Remotion Lambda user runs the exact same code in their function.
The React code you write is not contained in the function, it is hosted on the Serve URL.
Each function invocation is isolated and they cannot conflict each other. There is a concurrency limit, but it is per region, not per function.
I need to separate production, staging and development
Function invocations don't conflict each other.
Functions also don't contain any code that you write, they are binary and every Remotion Lambda user runs the exact same code.
It is impossible for a bad staging deployment to affect the production function.
Therefore, we recommend to use the same function for all environments.
I want to have different configurations for different functions
This is supported! You can have multiple functions with different configurations.
It is only not possible to have multiple functions that share the exact same configuration:
- Timeout
- RAM
- Region
- Disk size
- Remotion version
To distinguish which function should be used, pass the function name explicitly to renderMediaOnLambda()
.
You can pass --function-name
to npx remotion lambda render
I want to deploy multiple projects
It is possible deploy multiple sites under different Serve URLs.
This convention only applies to the renderer functions.