packages/docs/docs/lambda/multiple-buckets.mdx
The ideal setup is if you use 1 bucket per region and account that you use Remotion Lambda in.
While it is discouraged, it is possible to use multiple buckets from version v3.3.42 on.
It is not necessary to create multiple buckets because:
You might intuitively create multiple buckets because you have multiple environments, but it is usually not needed.
In addition to that, Remotion was not designed for multiple buckets. While you can explicitly specify a bucket name, it is optional and therefore easy to forget.
If you want to use multiple buckets nonetheless (applying different policies to them or fulfilling business or compliance requirements), you can create more buckets in the AWS console. Don't use getOrCreateBucket() to create them.
Remotion will by default discover buckets automatically and re-use them. If it detects multiple buckets, it will throw an error.
In order to avoid this error, you need to additionally explicitly pass the forceBucketName option to the following APIs:
Also you must pass a --force-bucket-name=your-bucket-name option to the following CLI commands:
npx remotion lambda rendernpx remotion lambda stillnpx remotion lambda compositionsnpx remotion lambda sites createnpx remotion lambda sites rmnpx remotion lambda sites rmallAlso you are unable to use the following APIs:
If you got an error message
You have multiple buckets [a,b,c] in your S3 region [us-east-1] starting with "remotionlambda-".
but you were not intending to use multiple buckets, delete the extraneous buckets in the AWS console to fix the error.