Skip to main content

Cannot create a S3 bucket using Remotion

import {UserPolicy} from '../../components/lambda/user-permissions.tsx';

Since approximately April 25th 2023, AWS blocks the creation of public buckets without extra configuration, making it impossible to create new S3 buckets with Remotion version v3.3.86 and older.

To make bucket creation work again, you need to upgrade to a newer Remotion version and update your user policy.

Problem

Users might see an error:

bash
InvalidBucketAclWithObjectOwnership: Bucket cannot have ACLs set with ObjectOwnership's BucketOwnerEnforced setting.
bash
InvalidBucketAclWithObjectOwnership: Bucket cannot have ACLs set with ObjectOwnership's BucketOwnerEnforced setting.

or

bash
AccessDenied: Access Denied
bash
AccessDenied: Access Denied

coming from the AWS SDK when trying to create a new site or bucket.

Cause

AWS does make all buckets private by default and Remotion tries to create a public bucket.

Resolution

1 Upgrade to Remotion v3.3.87 or later.

bash
npx remotion upgrade
bash
npx remotion upgrade
note

Note: When you upgrade Remotion, you will need to deploy new functions as well.

2 change your policies to give your user the s3

and s3
permission. The easiest way is to copy the following user policy:

Show full user permissions JSON file for latest Remotion Lambda version

or type in npx remotion lambda policies user after upgrading Remotion Lambda.

Go to the Users section in the AWS console and overwrite the JSON policy of your Remotion Lambda user with the above copied JSON.

You can verify that it worked by running npx remotion lambda policies validate.

3 Redeploy your functions. You don't need to delete your old functions as it might cause downtime for your application.

4 As a reminder, you also need to redeploy your site when you upgrade to a higher Remotion version.

5 If any values are hardcoded, update the function and site name in your application code.

Questions?

Join our Discord community to get help from the Remotion team and other users.