Skip to content

🎥 Make videos programmatically with React

skip getting location constraint if it's in the name

Jonny Burger79cae0f842f4
diff --git a/packages/lambda/src/api/get-buckets.ts b/packages/lambda/src/api/get-buckets.ts
index 8e239677e7..8a857e4e19 100644
--- a/packages/lambda/src/api/get-buckets.ts
+++ b/packages/lambda/src/api/get-buckets.ts
@@ -2,6 +2,7 @@ import {GetBucketLocationCommand, ListBucketsCommand} from '@aws-sdk/client-s3';
import type {AwsRegion} from '../pricing/aws-regions';
import {getS3Client} from '../shared/aws-clients';
import {REMOTION_BUCKET_PREFIX} from '../shared/constants';
+import {parseBucketName} from '../shared/validate-bucketname';
export type BucketWithLocation = {
name: string;
@@ -27,6 +28,11 @@ export const getRemotionS3Buckets = async (
const locations = await Promise.all(
remotionBuckets.map(async (bucket) => {
+ const {region: parsedRegion} = parseBucketName(bucket.Name as string);
+ if (parsedRegion) {
+ return parsedRegion;
+ }
+
const result = await getS3Client(region, null).send(
new GetBucketLocationCommand({
Bucket: bucket.Name as string,