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-542',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-542
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-.
Pass your function name directly to renderMediaOnLambdaAndStream() to stream progress and wait for the render to finish:
render.tsimport {downloadMedia } from '@remotion/lambda'; import {renderMediaOnLambdaAndStream } from '@remotion/lambda/client'; constfunctionName = 'acme-render-production-4-0-542'; constresult = awaitrenderMediaOnLambdaAndStream ({region : 'us-east-1',functionName ,serveUrl : 'https://example.com/my-remotion-site',composition : 'MyComposition',codec : 'h264',privacy : 'private',onProgress : ({overallProgress }) => {console .log (overallProgress ); }, }); const {outputPath } = awaitdownloadMedia ({region : 'us-east-1',renderId :result .renderId ,bucketName :result .bucket ,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-542
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-542',memorySizeInMb : 1536,diskSizeInMb : 2048,timeoutInSeconds : 120,createCloudWatchLogGroup : true, });console .log (rendererFunctionName );
Pass this name as rendererFunctionName, and keep the main function's name in functionName:
render-with-workers.tsimport {renderMediaOnLambdaAndStream } from '@remotion/lambda/client'; constresult = awaitrenderMediaOnLambdaAndStream ({region : 'us-east-1',functionName : 'acme-render-production-4-0-542',rendererFunctionName : 'acme-render-worker-4-0-542',serveUrl : 'https://example.com/my-remotion-site',composition : 'MyComposition',codec : 'h264',privacy : 'private',onProgress : ({overallProgress }) => {console .log (overallProgress ); }, });console .log (result .outputFile );