packages/docs/docs/cloudrun/getorcreatebucket.mdx
Creates a Cloud Storage bucket for Remotion Cloud Run in your GCP project. If one already exists, it will get returned instead.
Only 1 bucket per region is necessary for Remotion Cloud Run to function.
import {getOrCreateBucket} from '@remotion/cloudrun';
const {bucketName, alreadyExisted} = await getOrCreateBucket({
region: 'us-east1',
});
console.log(bucketName); // "remotioncloudrun-32df3p"
An object with the following properties:
regionThe GCP region which you want to create a bucket in.
updateBucketState?Callback function that returns a state (string) of operation. Used by the CLI to provide a progress update. State will be one of the following;
A promise resolving to an object with the following properties:
bucketNameThe name of your bucket that was found or created.
alreadyExistedA boolean indicating whether the bucket already existed or was newly created.