Skip to main content

getOrCreateBucket()

Creates a bucket for Remotion Lambda in your S3 account. If one already exists, it will get returned instead.

Only 1 bucket per region is necessary for Remotion Lambda to function.

ts
import { getOrCreateBucket } from "@remotion/lambda";
 
const { bucketName } = await getOrCreateBucket({ region: "us-east-1" });
 
console.log(bucketName); // "remotionlambda-32df3p"
ts
import { getOrCreateBucket } from "@remotion/lambda";
 
const { bucketName } = await getOrCreateBucket({ region: "us-east-1" });
 
console.log(bucketName); // "remotionlambda-32df3p"

Arguments

An object with the following property:

region

The AWS region which you want to create a bucket in.

onBucketEnsured?

optional

Allows to pass a callback after the bucket was created and before the S3 website option was enabled. This option exists so the CLI can better visualize the progress.

Return value

A promise resolving to an object with the following property:

bucketName

The name of your bucket that was found or created.

alreadyExisted

vv3.3.78A boolean indicating whether the bucket already existed or was newly created.

See also