A serverless framework plugin to automate deployment of remotion on AWS lambda
First, add Serverless Remotion Lambda to your project:
yarn add --dev serverless-remotion-lambda
# or
npm install -D serverless-remotion-lambda
Then inside your project's serverless.yml
file add following entry to the plugins section: serverless-remotion-lambda
. If there is no plugin section you will need to add it to the file.
plugins:
- serverless-remotion-lambda
custom:
remotion:
lambda:
architecture: arm64
createCloudWatchLogGroup: true
memorySizeInMb: 2048
timeoutInSeconds: 240
entryPoint: ./src/remotion/index.tsx
deployStage: prod
deployRegions:
- us-west-2
timeoutInSeconds: 20
bucketName: null
siteId: remotion-render-app-${remotion.version}
Notes:
entryPoint, deployStage, deployRegions
are mandatory.- bucketName:
null
to create new,remotionlambda-{name}
to use your own. > - can ref to s3 bucket name in stack- siteId: will append
{remotion.version}
automatically to the name
This plugin uses the official remotion-lambda packages
remotion-lambda
remotion-lambda-docs
this plugin will automatically add the following resources in your AWS account:
- Role policy:
remotion-lambda-policy
- Role:
remotion-lambda-role
- User:
remotion-user
- Inline user policy:
remotion-user-policy
- Temporally will add
AccessToken
to the created user to deploy the lambda function - CloudWatch log group
- S3 bucket
- Lambda
For further information see remotion-lambda-docs