Skip to content

🎥 Make videos programmatically with React

write doc about bucket naming

Jonny Burgerdc2586a8e46f
diff --git a/packages/docs/docs/lambda/bucket-naming.md b/packages/docs/docs/lambda/bucket-naming.md
index 243786741b..08d8719fc9 100644
--- a/packages/docs/docs/lambda/bucket-naming.md
+++ b/packages/docs/docs/lambda/bucket-naming.md
@@ -1,18 +1,55 @@
---
+image: /generated/articles-docs-lambda-bucket-naming.png
title: Bucket names in Remotion Lambda
slug: /lambda/bucket-naming
sidebar_label: Bucket naming
crumb: "@remotion/lambda"
---
-Remotion Lambda buckets by default are all prefixed `remotionlambda-` and contain their region.
+A Remotion Lambda bucket names (for example `remotionlambda-apsouth1-3ysk0nyazp`) has two special attributes:
-If you want to change the defaults , it comes with a few disadvantages.
+<Step>1</Step> It is prefixed with <code>remotionlambda-</code><br/>
+<Step>2</Step> It contains the region in their name <br/><br/>
-## Using a different bucket names
+It is not recommended to use a custom bucket name because it requires changing your policies and passing the bucket name explicitly to all APIs.
-## Region information in the name
+## Using a different bucket name
-The buckets contain the region in their name. This is because when the list of AWS buckets is obtained through the AWS API, the region is not included in the response. If the region is not in the bucket name, it needs to be queried for each bucket, which is a lot of extra API calls and can slow down the render.
+:::note
+By using a custom bucket name, . Ensure you are passing the bucket name explicitly to all APIs, especially to those for which the bucket name is optional. Also ensure that you the Lambda and S3 buckets ar
+:::
-If you set up your buckets with a Remotion version before December 2022, you have bucket names that do not include the region in their name. If you re-setup the buckets, you may get a speed gain and reduced API calls, especially if you have a lot of Remotion buckets across regions.
+To use a custom bucket name, you need to:
+
+- Manually create a bucket in AWS yourself
+- Change the [policies](/docs/lambda/permissions) created by Remotion Lambda to change the `remotionlambda-` prefix. This prefix is used to exlude non-Remotion buckets from being able to be accessed by credentials supposed for Remotion.
+- Pass the bucket name explicitly to:
+ - [`renderMediaOnLambda()`](/docs/lambda/rendermediaonlambda)
+ - [`getCompositionsOnLambda()`](/docs/lambda/getcompositionsonlambda)
+ - [`renderStillOnLambda()`](/docs/lambda/renderstillonlambda)
+ - [`npx remotion lambda render`](/docs/lambda/cli/render)
+ - [`npx remotion lambda still`](/docs/lambda/cli/render)
+ - [`npx remotion lambda compositions`](/docs/lambda/cli/render)
+ - [`npx remotion lambda sites create`](/docs/lambda/cli/sites#create)
+ - [`npx remotion lambda sites rm`](/docs/lambda/cli/sites#rm)
+ - [`npx remotion lambda sites rmall`](/docs/lambda/cli/sites#rmall)
+ using the `--force-bucket-name` or `forceBucketName` option respectively.
+- Be aware that the following APIs are unavailable when using custom bucket names:
+ - [`npx remotion lambda sites ls`](/docs/lambda/cli/sites#ls)
+ - [`getSites()`](/docs/lambda/getsites)
+ - [`getOrCreateBucket()`](/docs/lambda/getorcreatebucket)
+- Be aware that you are opting out of automatic bucket discovery and validation. Be careful to:
+ - Ensure that you are passing valid bucket names to all APIs, especially to those for which the bucket name is optional.
+ - Ensure that the buckets and Lambda functions that are interacting with each other are in the same region.
+
+## AWS Region in the name
+
+The buckets contain the region in their name (for example `remotionlambda-apsouth1-3ysk0nyazp`). This is because when the list of AWS buckets is obtained through the AWS API, the region is not included in the response.
+
+If the region is not in the bucket name, it needs to be queried for each bucket, which requires extra API calls and slows down the render.
+
+If you set up your buckets with a Remotion version before December 2022, you have bucket names that do not include the region in their name (for example `remotionlambda-0if1fa0wy0`). By renaming the buckets, you can speed up render and reduce API calls, especially if you have a lot of Remotion buckets across regions.
+
+## See also
+
+- [Multiple buckets](/docs/lambda/multiple-buckets)
diff --git a/packages/docs/docs/lambda/multiple-buckets.md b/packages/docs/docs/lambda/multiple-buckets.md
index 890b167b15..00d7c445ac 100644
--- a/packages/docs/docs/lambda/multiple-buckets.md
+++ b/packages/docs/docs/lambda/multiple-buckets.md
@@ -59,3 +59,7 @@ You have multiple buckets [a,b,c] in your S3 region [us-east-1] starting with "r
```
but you were not intending to use multiple buckets, delete the extraneous buckets in the AWS console to fix the error.
+
+## See also
+
+- [Bucket naming](/docs/lambda/bucket-naming)
diff --git a/packages/docs/src/data/articles.ts b/packages/docs/src/data/articles.ts
index 0cbb225a6c..e3809354d9 100644
--- a/packages/docs/src/data/articles.ts
+++ b/packages/docs/src/data/articles.ts
@@ -482,6 +482,13 @@ export const articles = [
compId: "articles-docs-lambda-authentication",
crumb: "Lambda",
},
+ {
+ id: "lambda/bucket-naming",
+ title: "Bucket names in Remotion Lambda",
+ relativePath: "docs/lambda/bucket-naming.md",
+ compId: "articles-docs-lambda-bucket-naming",
+ crumb: "@remotion/lambda",
+ },
{
id: "changelog",
title: "Prerelease Changelog",
diff --git a/packages/docs/static/generated/articles-docs-lambda-bucket-naming.png b/packages/docs/static/generated/articles-docs-lambda-bucket-naming.png
new file mode 100644
index 0000000000..8086ae4658
Binary files /dev/null and b/packages/docs/static/generated/articles-docs-lambda-bucket-naming.png differ