Files
supabase/apps/studio/components/interfaces/ProjectCreation/ProjectCreation.utils.ts
Joshen Lim e7a9131d56 Allow apse1 on staging and local only (#20897)
* Allow apse1 on staging and local only

* Fix

* Fix

* Fix

* Fix

* Fix
2024-01-31 15:50:16 +07:00

15 lines
492 B
TypeScript

import { AWS_REGIONS, CloudProvider, FLY_REGIONS, Region } from 'lib/constants'
import { pluckObjectFields } from 'lib/helpers'
export function getAvailableRegions(cloudProvider: CloudProvider): Region {
if (cloudProvider === 'AWS') {
return process.env.NEXT_PUBLIC_ENVIRONMENT === 'staging'
? pluckObjectFields(AWS_REGIONS, ['SOUTHEAST_ASIA'])
: AWS_REGIONS
} else if (cloudProvider === 'FLY') {
return FLY_REGIONS
}
throw new Error('Invalid cloud provider')
}