Home / Function/ getAvailableRegions() — supabase Function Reference

getAvailableRegions() — supabase Function Reference

Architecture documentation for the getAvailableRegions() function in ProjectCreation.utils.ts from the supabase codebase.

Entity Profile

Dependency Diagram

graph TD
  3d36b3aa_ec96_0365_b7bd_5d2423fd6a1e["getAvailableRegions()"]
  212c1971_f7e0_37c1_5824_22c51aafb34e["RegionSelector()"]
  212c1971_f7e0_37c1_5824_22c51aafb34e -->|calls| 3d36b3aa_ec96_0365_b7bd_5d2423fd6a1e
  style 3d36b3aa_ec96_0365_b7bd_5d2423fd6a1e fill:#6366f1,stroke:#818cf8,color:#fff

Relationship Graph

Source Code

apps/studio/components/interfaces/ProjectCreation/ProjectCreation.utils.ts lines 10–32

export function getAvailableRegions(cloudProvider: CloudProvider): Region {
  switch (cloudProvider) {
    case 'AWS':
    case 'AWS_K8S':
      return AWS_REGIONS
    case 'AWS_NIMBUS':
      if (process.env.NEXT_PUBLIC_ENVIRONMENT !== 'prod') {
        // Only allow Southeast Asia for Nimbus (local/staging)
        return {
          SOUTHEAST_ASIA: AWS_REGIONS.SOUTHEAST_ASIA,
        }
      }

      // Only allow US East for Nimbus (prod)
      return {
        EAST_US: AWS_REGIONS.EAST_US,
      }
    case 'FLY':
      return FLY_REGIONS
    default:
      throw new Error('Invalid cloud provider')
  }
}

Subdomains

Called By

Frequently Asked Questions

What does getAvailableRegions() do?
getAvailableRegions() is a function in the supabase codebase.
What calls getAvailableRegions()?
getAvailableRegions() is called by 1 function(s): RegionSelector.

Analyze Your Own Codebase

Get architecture documentation, dependency graphs, and domain analysis for your codebase in minutes.

Try Supermodel Free