Skip to content

🎥 Make videos programmatically with React

no acl option

Jonny Burger743d604460fd
diff --git a/packages/docs/docs/lambda/cli/render.md b/packages/docs/docs/lambda/cli/render.md
index a2a37a86d8..4a3019cb00 100644
--- a/packages/docs/docs/lambda/cli/render.md
+++ b/packages/docs/docs/lambda/cli/render.md
@@ -79,7 +79,11 @@ Log level to be used inside the Lambda function. Also, if you set it to `verbose
### `--privacy`
-Defines if the output media is accessible for everyone or not. Either `public` or `private`, default `public`.
+One of:
+
+- `"public"` (_default_): The rendered media is publicly accessible under the S3 URL.
+- `"private"`: The rendered media is not publicly available, but signed links can be created using [presignUrl()](/docs/lambda/presignurl).
+- `"no-acl"` (_available from v.3.1.7_): The ACL option is not being set at all, this option is useful if you are writing to another bucket that does not support ACL using [`outName`](#outname).
### `--max-retries`
diff --git a/packages/docs/docs/lambda/rendermediaonlambda.md b/packages/docs/docs/lambda/rendermediaonlambda.md
index 90eaf53b4f..c16ca9330e 100644
--- a/packages/docs/docs/lambda/rendermediaonlambda.md
+++ b/packages/docs/docs/lambda/rendermediaonlambda.md
@@ -40,7 +40,11 @@ In which region your Lambda function is deployed. It's highly recommended that y
### `privacy`
-Either `"public"` or `"private"`, determining whether the video can be seen by anyone after it's uploaded to the S3 bucket.
+One of:
+
+- `"public"` (_default_): The rendered media is publicly accessible under the S3 URL.
+- `"private"`: The rendered media is not publicly available, but signed links can be created using [presignUrl()](/docs/lambda/presignurl).
+- `"no-acl"` (_available from v.3.1.7_): The ACL option is not being set at all, this option is useful if you are writing to another bucket that does not support ACL using [`outName`](#outname).
### `functionName`
diff --git a/packages/docs/docs/lambda/renderstillonlambda.md b/packages/docs/docs/lambda/renderstillonlambda.md
index 103e30220f..9818dd2c81 100644
--- a/packages/docs/docs/lambda/renderstillonlambda.md
+++ b/packages/docs/docs/lambda/renderstillonlambda.md
@@ -60,7 +60,11 @@ React props that are passed to your composition. You define the shape of the pro
### `privacy`
-Whether the output in the S3 bucket should be public or private. Either `"private"` or `"public"`.
+One of:
+
+- `"public"` (_default_): The rendered still is publicly accessible under the S3 URL.
+- `"private"`: The rendered still is not publicly available, but signed links can be created using [presignUrl()](/docs/lambda/presignurl).
+- `"no-acl"` (_available from v.3.1.7_): The ACL option is not being set at all, this option is useful if you are writing to another bucket that does not support ACL using [`outName`](#outname).
### `frame`
diff --git a/packages/lambda/src/api/__mocks__/mock-s3.ts b/packages/lambda/src/api/__mocks__/mock-s3.ts
index 95a6b66700..9968f1e244 100644
--- a/packages/lambda/src/api/__mocks__/mock-s3.ts
+++ b/packages/lambda/src/api/__mocks__/mock-s3.ts
@@ -5,7 +5,7 @@ import type {AwsRegion} from '../../pricing/aws-regions';
type S3MockFile = {
bucketName: string;
region: AwsRegion;
- acl: 'public-read' | 'private';
+ acl: 'public-read' | 'private' | 'none';
key: string;
content: string | ReadStream;
};
@@ -31,7 +31,12 @@ export const writeMockS3File = ({
}) => {
mockS3Store.push({
content: body,
- acl: privacy === 'public' ? 'public-read' : 'private',
+ acl:
+ privacy === 'no-acl'
+ ? 'none'
+ : privacy === 'public'
+ ? 'public-read'
+ : 'private',
bucketName,
key,
region,
diff --git a/packages/lambda/src/api/__mocks__/upload-dir.ts b/packages/lambda/src/api/__mocks__/upload-dir.ts
index d96f611a36..67f9ea85ba 100644
--- a/packages/lambda/src/api/__mocks__/upload-dir.ts
+++ b/packages/lambda/src/api/__mocks__/upload-dir.ts
@@ -35,7 +35,12 @@ export const uploadDir: typeof original = async (input) => {
const files = getDirFiles(input.dir);
for (const file of files) {
mockS3Upload({
- acl: input.privacy === 'private' ? 'private' : 'public-read',
+ acl:
+ input.privacy === 'no-acl'
+ ? 'none'
+ : input.privacy === 'private'
+ ? 'private'
+ : 'public-read',
bucketName: input.bucket,
content: file.content,
// Should not use path.join here because on Windows it's not / separator
diff --git a/packages/lambda/src/api/render-still-on-lambda.ts b/packages/lambda/src/api/render-still-on-lambda.ts
index a1457df628..dfd5777862 100644
--- a/packages/lambda/src/api/render-still-on-lambda.ts
+++ b/packages/lambda/src/api/render-still-on-lambda.ts
@@ -5,7 +5,7 @@ import type {
} from '@remotion/renderer';
import type {AwsRegion} from '../pricing/aws-regions';
import {callLambda} from '../shared/call-lambda';
-import type {CostsInfo, OutNameInput} from '../shared/constants';
+import type {CostsInfo, OutNameInput, Privacy} from '../shared/constants';
import {DEFAULT_MAX_RETRIES, LambdaRoutines} from '../shared/constants';
import type {DownloadBehavior} from '../shared/content-disposition-header';
import {convertToServeUrl} from '../shared/convert-to-serve-url';
@@ -17,7 +17,7 @@ export type RenderStillOnLambdaInput = {
composition: string;
inputProps: unknown;
imageFormat: StillImageFormat;
- privacy: 'private' | 'public';
+ privacy: Privacy;
maxRetries?: number;
envVariables?: Record<string, string>;
quality?: number;
diff --git a/packages/lambda/src/api/upload-dir.ts b/packages/lambda/src/api/upload-dir.ts
index 235c724e32..e076e8134d 100644
--- a/packages/lambda/src/api/upload-dir.ts
+++ b/packages/lambda/src/api/upload-dir.ts
@@ -77,7 +77,12 @@ export const uploadDir = async ({
const Key = makeS3Key(folder, dir, filePath.name);
const Body = createReadStream(filePath.name);
const ContentType = mimeTypes.lookup(Key) || 'application/octet-stream';
- const ACL = privacy === 'private' ? 'private' : 'public-read';
+ const ACL =
+ privacy === 'no-acl'
+ ? undefined
+ : privacy === 'private'
+ ? 'private'
+ : 'public-read';
if (filePath.size > 5 * 1024 * 1024) {
const paralellUploads3 = new Upload({
client,
diff --git a/packages/lambda/src/functions/helpers/io.ts b/packages/lambda/src/functions/helpers/io.ts
index b0676f3d12..519bf03407 100644
--- a/packages/lambda/src/functions/helpers/io.ts
+++ b/packages/lambda/src/functions/helpers/io.ts
@@ -96,7 +96,12 @@ export const lambdaWriteFile = async ({
Bucket: bucketName,
Key: key,
Body: body,
- ACL: privacy === 'private' ? 'private' : 'public-read',
+ ACL:
+ privacy === 'no-acl'
+ ? undefined
+ : privacy === 'private'
+ ? 'private'
+ : 'public-read',
ExpectedBucketOwner: expectedBucketOwner ?? undefined,
ContentType: mimeTypes.lookup(key) || 'application/octet-stream',
ContentDisposition: getContentDispositionHeader(downloadBehavior),
diff --git a/packages/lambda/src/shared/constants.ts b/packages/lambda/src/shared/constants.ts
index 8bc1d6a22c..f6958dc40d 100644
--- a/packages/lambda/src/shared/constants.ts
+++ b/packages/lambda/src/shared/constants.ts
@@ -473,7 +473,7 @@ export type RenderProgress = {
mostExpensiveFrameRanges: ExpensiveChunk[] | null;
};
-export type Privacy = 'public' | 'private';
+export type Privacy = 'public' | 'private' | 'no-acl';
export const LAMBDA_CONCURRENCY_LIMIT_QUOTA = 'L-B99A9384';
export const LAMBDA_BURST_LIMIT_QUOTA = 'L-548AE339';
diff --git a/packages/lambda/src/shared/validate-privacy.ts b/packages/lambda/src/shared/validate-privacy.ts
index d931becae4..e2a2ef6a2f 100644
--- a/packages/lambda/src/shared/validate-privacy.ts
+++ b/packages/lambda/src/shared/validate-privacy.ts
@@ -5,7 +5,9 @@ export function validatePrivacy(privacy: unknown): asserts privacy is Privacy {
throw new TypeError('Privacy must be a string');
}
- if (privacy !== 'private' && privacy !== 'public') {
- throw new TypeError('Privacy must be either "private" or "public-read"');
+ if (privacy !== 'private' && privacy !== 'public' && privacy !== 'no-acl') {
+ throw new TypeError(
+ 'Privacy must be either "private", "public-read" or "no-acl"'
+ );
}
}