Custom Lambda function namesv4.0.540
While we recommend the default Lambda function names, the organization you work for might have naming conventions that you need to follow.
You can override the default function name to meet organizational naming requirements or deploy separate functions with the same configuration.
If you do so, there are a couple of extra steps you need to take.
Configure IAM permissions
The user and role policies are scoped to the remotion-render- prefix by default.
Change them first so they apply to your function names.
Deploy with a custom name
Pass functionName to deployFunction():
deploy.tsimport {deployFunction } from '@remotion/lambda'; const {functionName } = awaitdeployFunction ({region : 'us-east-1',functionName : 'acme-render-production-4-0-540',memorySizeInMb : 2048,diskSizeInMb : 2048,timeoutInSeconds : 120,createCloudWatchLogGroup : true, });console .log (functionName );
Or pass --function-name to the CLI:
Terminalnpx remotion lambda functions deploy --region=us-east-1 --function-name=acme-render-production-4-0-540
Names must contain 1–64 letters, digits, hyphens or underscores.
Deploying again with the same name, Remotion version, memory size, disk size and timeout reuses the existing function.
If those values differ, choose another name or delete the existing function before deploying.
Including the Remotion version in your custom name lets you deploy upgrades alongside functions still serving renders.
Select the function explicitly
getFunctions() and remotion lambda functions ls only discover names starting with remotion-render-.
When invoking, pass your function name directly to rendering and progress APIs instead of selecting it from getFunctions():
render.tsimport {downloadMedia } from '@remotion/lambda'; import {getRenderProgress ,renderMediaOnLambda } from '@remotion/lambda/client'; constfunctionName = 'acme-render-production-4-0-540'; const {renderId ,bucketName } = awaitrenderMediaOnLambda ({region : 'us-east-1',functionName ,serveUrl : 'https://example.com/my-remotion-site',composition : 'MyComposition',codec : 'h264',privacy : 'private', }); while (true) { constprogress = awaitgetRenderProgress ({region : 'us-east-1',functionName ,renderId ,bucketName ,skipLambdaInvocation : true, }); if (progress .fatalErrorEncountered ) { throw newError (JSON .stringify (progress .errors )); } if (progress .done ) { break; }console .log (progress .overallProgress ); await newPromise ((resolve ) =>setTimeout (resolve , 1000)); } const {outputPath } = awaitdownloadMedia ({region : 'us-east-1',renderId ,bucketName ,outPath : 'out.mp4', });console .log (outputPath );
For CLI renders, use --function-name to pass the name explicitly:
Terminalnpx remotion lambda render https://example.com/my-remotion-site MyComposition --region=us-east-1 --function-name=acme-render-production-4-0-540
Use a separate renderer function
You can give the main function and renderer workers different names and memory sizes. Deploy a second function with the same Remotion version in the same account and region:
deploy-renderer.tsimport {deployFunction } from '@remotion/lambda'; const {functionName :rendererFunctionName } = awaitdeployFunction ({region : 'us-east-1',functionName : 'acme-render-worker-4-0-540',memorySizeInMb : 1536,diskSizeInMb : 2048,timeoutInSeconds : 120,createCloudWatchLogGroup : true, });console .log (rendererFunctionName );
Pass this name as rendererFunctionName when starting the render. Continue passing the main function's name to getRenderProgress():
render-with-workers.tsimport {renderMediaOnLambda } from '@remotion/lambda/client'; const {renderId ,bucketName } = awaitrenderMediaOnLambda ({region : 'us-east-1',functionName : 'acme-render-production-4-0-540',rendererFunctionName : 'acme-render-worker-4-0-540',serveUrl : 'https://example.com/my-remotion-site',composition : 'MyComposition',codec : 'h264',privacy : 'private', });