Skip to content

🎥 Make videos programmatically with React

`@remotion/lambda`: Skip PutBucketAcl if --privacy=no-acl was passed

Jonny Burgeree47c0c9fa31
diff --git a/packages/lambda/src/api/get-compositions-on-lambda.ts b/packages/lambda/src/api/get-compositions-on-lambda.ts
index 09eafd2849..f7d8adc38d 100644
--- a/packages/lambda/src/api/get-compositions-on-lambda.ts
+++ b/packages/lambda/src/api/get-compositions-on-lambda.ts
@@ -71,6 +71,7 @@ export const getCompositionsOnLambda = async ({
]),
providerSpecifics: awsImplementation,
forcePathStyle: forcePathStyle ?? false,
+ skipPutAcl: false,
});
try {
diff --git a/packages/lambda/src/api/get-or-create-bucket.ts b/packages/lambda/src/api/get-or-create-bucket.ts
index 06366cc27c..487f3433e9 100644
--- a/packages/lambda/src/api/get-or-create-bucket.ts
+++ b/packages/lambda/src/api/get-or-create-bucket.ts
@@ -18,5 +18,6 @@ export const getOrCreateBucket = (
customCredentials: options.customCredentials ?? null,
providerSpecifics: awsImplementation,
forcePathStyle: false,
+ skipPutAcl: false,
});
};
diff --git a/packages/lambda/src/api/make-lambda-payload.ts b/packages/lambda/src/api/make-lambda-payload.ts
index 7b16963d0b..7e9716496a 100644
--- a/packages/lambda/src/api/make-lambda-payload.ts
+++ b/packages/lambda/src/api/make-lambda-payload.ts
@@ -159,6 +159,7 @@ export const makeLambdaRenderMediaPayload = async ({
propsType: 'input-props',
providerSpecifics: awsImplementation,
forcePathStyle: forcePathStyle ?? false,
+ skipPutAcl: privacy === 'no-acl',
});
return {
rendererFunctionName,
@@ -272,6 +273,7 @@ export const makeLambdaRenderStillPayload = async ({
propsType: 'input-props',
providerSpecifics: awsImplementation,
forcePathStyle,
+ skipPutAcl: privacy === 'no-acl',
});
return {
diff --git a/packages/lambda/src/cli/commands/sites/create.ts b/packages/lambda/src/cli/commands/sites/create.ts
index c5994e1469..f10ca8dee2 100644
--- a/packages/lambda/src/cli/commands/sites/create.ts
+++ b/packages/lambda/src/cli/commands/sites/create.ts
@@ -141,6 +141,7 @@ export const sitesCreateSubcommand = async (
customCredentials: null,
providerSpecifics: implementation,
forcePathStyle: false,
+ skipPutAcl: parsedLambdaCli.privacy === 'no-acl',
})
).bucketName;
diff --git a/packages/lambda/src/cli/commands/sites/rm.ts b/packages/lambda/src/cli/commands/sites/rm.ts
index 13a95d893d..e1d615ef1c 100644
--- a/packages/lambda/src/cli/commands/sites/rm.ts
+++ b/packages/lambda/src/cli/commands/sites/rm.ts
@@ -45,6 +45,7 @@ export const sitesRmSubcommand = async (
customCredentials: null,
providerSpecifics: implementation,
forcePathStyle: false,
+ skipPutAcl: false,
})
).bucketName;
diff --git a/packages/lambda/src/cli/commands/sites/rmall.ts b/packages/lambda/src/cli/commands/sites/rmall.ts
index 487c64aeb2..6daf385fdf 100644
--- a/packages/lambda/src/cli/commands/sites/rmall.ts
+++ b/packages/lambda/src/cli/commands/sites/rmall.ts
@@ -30,6 +30,7 @@ export const sitesRmallSubcommand = async (
customCredentials: null,
providerSpecifics: implementation,
forcePathStyle: false,
+ skipPutAcl: false,
})
).bucketName;
diff --git a/packages/lambda/src/functions/launch.ts b/packages/lambda/src/functions/launch.ts
index 9604a5dd00..6ddba39b98 100644
--- a/packages/lambda/src/functions/launch.ts
+++ b/packages/lambda/src/functions/launch.ts
@@ -218,6 +218,7 @@ const innerLaunchHandler = async <Provider extends CloudProvider>({
needsToUpload,
providerSpecifics,
forcePathStyle: params.forcePathStyle,
+ skipPutAcl: false,
});
registerCleanupTask(() => {
diff --git a/packages/lambda/src/functions/start.ts b/packages/lambda/src/functions/start.ts
index a3147e4eb8..aad816d126 100644
--- a/packages/lambda/src/functions/start.ts
+++ b/packages/lambda/src/functions/start.ts
@@ -49,6 +49,7 @@ export const startHandler = async <Provider extends CloudProvider>(
customCredentials: null,
providerSpecifics,
forcePathStyle: params.forcePathStyle,
+ skipPutAcl: false,
})
).bucketName;
const realServeUrl = providerSpecifics.convertToServeUrl({
diff --git a/packages/lambda/src/functions/still.ts b/packages/lambda/src/functions/still.ts
index 21111d8dc5..5fbd0d4356 100644
--- a/packages/lambda/src/functions/still.ts
+++ b/packages/lambda/src/functions/still.ts
@@ -104,6 +104,7 @@ const innerStillHandler = async <Provider extends CloudProvider>(
customCredentials: null,
providerSpecifics,
forcePathStyle: lambdaParams.forcePathStyle,
+ skipPutAcl: false,
}).then((b) => b.bucketName);
const outputDir = RenderInternals.tmpDir('remotion-render-');
diff --git a/packages/lambda/src/test/integration/delete-site.test.ts b/packages/lambda/src/test/integration/delete-site.test.ts
index 9f078a413e..b8c7f10e3d 100644
--- a/packages/lambda/src/test/integration/delete-site.test.ts
+++ b/packages/lambda/src/test/integration/delete-site.test.ts
@@ -11,6 +11,7 @@ test('Return 0 total size if site did not exist', async () => {
customCredentials: null,
enableFolderExpiry: null,
forcePathStyle: false,
+ skipPutAcl: false,
});
expect(
await internalDeleteSite({
@@ -30,6 +31,7 @@ test('Return more than 0 total size if site did not exist', async () => {
customCredentials: null,
enableFolderExpiry: null,
forcePathStyle: false,
+ skipPutAcl: false,
});
const {siteName} = await internalDeploySite({
bucketName,
diff --git a/packages/lambda/src/test/integration/deploy-site.test.ts b/packages/lambda/src/test/integration/deploy-site.test.ts
index 2dff2beb31..39b2a87163 100644
--- a/packages/lambda/src/test/integration/deploy-site.test.ts
+++ b/packages/lambda/src/test/integration/deploy-site.test.ts
@@ -71,6 +71,7 @@ test('Should apply name if given', async () => {
customCredentials: null,
enableFolderExpiry: false,
forcePathStyle: false,
+ skipPutAcl: false,
});
expect(
await internalDeploySite({
@@ -106,6 +107,7 @@ test('Should overwrite site if given siteName is already taken', async () => {
customCredentials: null,
enableFolderExpiry: false,
forcePathStyle: false,
+ skipPutAcl: false,
});
expect(
@@ -142,6 +144,7 @@ test('Should delete the previous site if deploying the new one', async () => {
customCredentials: null,
enableFolderExpiry: false,
forcePathStyle: false,
+ skipPutAcl: false,
});
await internalDeploySite({
@@ -199,6 +202,7 @@ test('Should keep the previous site if deploying the new one with different ID',
customCredentials: null,
enableFolderExpiry: false,
forcePathStyle: false,
+ skipPutAcl: false,
});
await internalDeploySite({
@@ -276,6 +280,7 @@ test('Should not delete site with same prefix', async () => {
customCredentials: null,
enableFolderExpiry: false,
forcePathStyle: false,
+ skipPutAcl: false,
});
await internalDeploySite({
diff --git a/packages/lambda/src/test/integration/get-sites.test.ts b/packages/lambda/src/test/integration/get-sites.test.ts
index e757ab9443..4870f04c79 100644
--- a/packages/lambda/src/test/integration/get-sites.test.ts
+++ b/packages/lambda/src/test/integration/get-sites.test.ts
@@ -22,6 +22,7 @@ test('Should have a site after deploying', async () => {
customCredentials: null,
enableFolderExpiry: null,
forcePathStyle: false,
+ skipPutAcl: false,
});
expect(
await internalDeploySite({
diff --git a/packages/serverless/src/compositions.ts b/packages/serverless/src/compositions.ts
index 2cb5bf6d1a..4595536df6 100644
--- a/packages/serverless/src/compositions.ts
+++ b/packages/serverless/src/compositions.ts
@@ -53,6 +53,7 @@ export const compositionsHandler = async <Provider extends CloudProvider>(
customCredentials: null,
providerSpecifics,
forcePathStyle: lambdaParams.forcePathStyle,
+ skipPutAcl: false,
}).then((b) => b.bucketName);
const bucketName = await bucketNamePromise;
diff --git a/packages/serverless/src/compress-props.ts b/packages/serverless/src/compress-props.ts
index 2df7ff218f..57da93c3e1 100644
--- a/packages/serverless/src/compress-props.ts
+++ b/packages/serverless/src/compress-props.ts
@@ -68,6 +68,7 @@ export const compressInputProps = async <Provider extends CloudProvider>({
needsToUpload,
providerSpecifics,
forcePathStyle,
+ skipPutAcl,
}: {
stringifiedInputProps: string;
region: Provider['region'];
@@ -76,6 +77,7 @@ export const compressInputProps = async <Provider extends CloudProvider>({
needsToUpload: boolean;
providerSpecifics: ProviderSpecifics<Provider>;
forcePathStyle: boolean;
+ skipPutAcl: boolean;
}): Promise<SerializedInputProps> => {
const hash = providerSpecifics.randomHash();
@@ -89,6 +91,7 @@ export const compressInputProps = async <Provider extends CloudProvider>({
customCredentials: null,
providerSpecifics,
forcePathStyle,
+ skipPutAcl,
})
).bucketName;
diff --git a/packages/serverless/src/get-or-create-bucket.ts b/packages/serverless/src/get-or-create-bucket.ts
index 928ac53b5a..6eea5db5aa 100644
--- a/packages/serverless/src/get-or-create-bucket.ts
+++ b/packages/serverless/src/get-or-create-bucket.ts
@@ -10,6 +10,7 @@ type GetOrCreateBucketInputInner<Provider extends CloudProvider> = {
customCredentials: CustomCredentials<Provider> | null;
providerSpecifics: ProviderSpecifics<Provider>;
forcePathStyle: boolean;
+ skipPutAcl: boolean;
};
export type GetOrCreateBucketInput<Provider extends CloudProvider> = {
@@ -63,6 +64,7 @@ export const internalGetOrCreateBucket = async <Provider extends CloudProvider>(
bucketName,
region: params.region,
forcePathStyle: params.forcePathStyle,
+ skipPutAcl: params.skipPutAcl,
});
// apply to newly created bucket
diff --git a/packages/serverless/src/provider-implementation.ts b/packages/serverless/src/provider-implementation.ts
index 81aaeb499f..690511fe86 100644
--- a/packages/serverless/src/provider-implementation.ts
+++ b/packages/serverless/src/provider-implementation.ts
@@ -20,6 +20,7 @@ type CreateBucket<Provider extends CloudProvider> = (params: {
region: Provider['region'];
bucketName: string;
forcePathStyle: boolean;
+ skipPutAcl: boolean;
}) => Promise<void>;
type ApplyLifeCycle<Provider extends CloudProvider> = (params: {