remotion-dev/remotion · error · Error

You don't have the required permissions to create lifecycle

Error message

You don't have the required permissions to create lifecycle rules on the bucket "${bucketName}", but the "enableFolderExpiry" was set to true. Ensure that your user has the "s3:PutLifecycleConfiguration" permission.

What it means

When enableFolderExpiry is true, Remotion calls PutBucketLifecycleConfiguration on the bucket. If the IAM user lacks s3:PutLifecycleConfiguration, AWS returns AccessDenied (matched in the error stack) and this clear message is thrown naming the bucket and the missing permission.

Source

Thrown at packages/lambda-client/src/lifecycle-rules.ts:44

	const lcRules = getLifeCycleRules();
	// create the lifecyle rules
	const createCommandInput = createLifeCycleInput({
		bucketName,
		lcRules,
	});
	const createCommand = new PutBucketLifecycleConfigurationCommand(
		createCommandInput,
	);
	try {
		await getS3Client({
			region,
			customCredentials,
			forcePathStyle,
			requestHandler,
		}).send(createCommand);
	} catch (err) {
		if ((err as Error).stack?.includes('AccessDenied')) {
			throw new Error(
				`You don't have the required permissions to create lifecycle rules on the bucket "${bucketName}", but the "enableFolderExpiry" was set to true. Ensure that your user has the "s3:PutLifecycleConfiguration" permission.`,
			);
		}
	}
};

const deleteLCRules = async ({
	bucketName,
	region,
	customCredentials,
	forcePathStyle,
	requestHandler,
}: {
	bucketName: string;
	region: AwsRegion;
	customCredentials: CustomCredentials<AwsProvider> | null;
	forcePathStyle: boolean;
	requestHandler: RequestHandler | null;

View on GitHub (pinned to 78fe4bb3fd)

Solutions

  1. Add s3:PutLifecycleConfiguration to the IAM user/role policy
  2. Or disable enableFolderExpiry if folder expiry is not required

Example fix

// before
await getOrCreateBucket({ enableFolderExpiry: true, ... }); // IAM lacks the perm

// after - either grant the permission or turn the flag off
await getOrCreateBucket({ enableFolderExpiry: false, ... });
Defensive patterns

Strategy: validation

Validate before calling

// Before calling with enableFolderExpiry, confirm the permission is available,
// otherwise disable the flag
const enableFolderExpiry = iamAllows('s3:PutLifecycleConfiguration') ? true : false;

Try / catch

try {
  await getOrCreateBucket({ enableFolderExpiry: true, ... });
} catch (err) {
  if ((err as Error).message.includes('s3:PutLifecycleConfiguration')) {
    // either grant the permission or set enableFolderExpiry:false and retry
  }
  throw err;
}

Prevention

When it happens

Trigger: Calling getOrCreateBucket (or any bucket op that applies lifecycle rules) with enableFolderExpiry:true under an IAM policy missing s3:PutLifecycleConfiguration.

Common situations: Adding enableFolderExpiry to an existing setup without updating the IAM policy; minimal/corporate restricted policy.

Related errors


AI-assisted analysis of remotion-dev/remotion@78fe4bb3fd (2026-08-12). Data as JSON: /api/errors/455853e279c76e2c. Report an issue: GitHub.