diff --git a/apps/studio/components/interfaces/ProjectCreation/ProjectCreation.utils.ts b/apps/studio/components/interfaces/ProjectCreation/ProjectCreation.utils.ts index 07d460f1bceb7..9d1b56009d085 100644 --- a/apps/studio/components/interfaces/ProjectCreation/ProjectCreation.utils.ts +++ b/apps/studio/components/interfaces/ProjectCreation/ProjectCreation.utils.ts @@ -4,7 +4,7 @@ import { AWS_REGIONS, FLY_REGIONS } from 'shared-data' export function getAvailableRegions(cloudProvider: CloudProvider): Region { switch (cloudProvider) { case 'AWS': - case 'AWS_NEW': + case 'AWS_K8S': return AWS_REGIONS case 'FLY': return FLY_REGIONS diff --git a/apps/studio/components/interfaces/Settings/General/Infrastructure/PauseProjectButton.tsx b/apps/studio/components/interfaces/Settings/General/Infrastructure/PauseProjectButton.tsx index 96c1465002a27..b9676119c4325 100644 --- a/apps/studio/components/interfaces/Settings/General/Infrastructure/PauseProjectButton.tsx +++ b/apps/studio/components/interfaces/Settings/General/Infrastructure/PauseProjectButton.tsx @@ -14,7 +14,7 @@ import { useProjectPauseMutation } from 'data/projects/project-pause-mutation' import { setProjectStatus } from 'data/projects/projects-query' import { useCheckPermissions } from 'hooks/misc/useCheckPermissions' import { useSelectedOrganization } from 'hooks/misc/useSelectedOrganization' -import { useIsAwsNew } from 'hooks/misc/useSelectedProject' +import { useIsAwsK8s } from 'hooks/misc/useSelectedProject' import { PROJECT_STATUS } from 'lib/constants' import ConfirmationModal from 'ui-patterns/Dialogs/ConfirmationModal' @@ -33,9 +33,9 @@ const PauseProjectButton = () => { 'queue_jobs.projects.pause' ) - const isAwsNew = useIsAwsNew() + const isAwsK8s = useIsAwsK8s() const isFreePlan = organization?.plan.id === 'free' - const isPaidAndNotAwsNew = !isFreePlan && !isAwsNew + const isPaidAndNotAwsK8s = !isFreePlan && !isAwsK8s const { mutate: pauseProject, isLoading: isPausing } = useProjectPauseMutation({ onSuccess: (_, variables) => { @@ -53,7 +53,7 @@ const PauseProjectButton = () => { } const buttonDisabled = - isPaidAndNotAwsNew || project === undefined || isPaused || !canPauseProject || !isProjectActive + isPaidAndNotAwsK8s || project === undefined || isPaused || !canPauseProject || !isProjectActive return ( <> @@ -72,7 +72,7 @@ const PauseProjectButton = () => { ? 'You need additional permissions to pause this project' : !isProjectActive ? 'Unable to pause project as project is not active' - : isPaidAndNotAwsNew + : isPaidAndNotAwsK8s ? 'Projects on a paid plan will always be running' : undefined, }, diff --git a/apps/studio/data/projects/new-project.constants.ts b/apps/studio/data/projects/new-project.constants.ts index 98240ddd5dd64..58f55cf9faae6 100644 --- a/apps/studio/data/projects/new-project.constants.ts +++ b/apps/studio/data/projects/new-project.constants.ts @@ -31,7 +31,7 @@ export const instanceSizeSpecs: Record< cpu: '2-core', priceHourly: 0.01344, priceMonthly: 10, - cloud_providers: [PROVIDERS.AWS.id, PROVIDERS.AWS_NEW.id, PROVIDERS.FLY.id], + cloud_providers: [PROVIDERS.AWS.id, PROVIDERS.AWS_K8S.id, PROVIDERS.FLY.id], }, small: { label: 'Small', @@ -39,7 +39,7 @@ export const instanceSizeSpecs: Record< cpu: '2-core', priceHourly: 0.0206, priceMonthly: 15, - cloud_providers: [PROVIDERS.AWS.id, PROVIDERS.AWS_NEW.id, PROVIDERS.FLY.id], + cloud_providers: [PROVIDERS.AWS.id, PROVIDERS.AWS_K8S.id, PROVIDERS.FLY.id], }, medium: { label: 'Medium', @@ -47,7 +47,7 @@ export const instanceSizeSpecs: Record< cpu: '2-core', priceHourly: 0.0822, priceMonthly: 60, - cloud_providers: [PROVIDERS.AWS.id, PROVIDERS.AWS_NEW.id, PROVIDERS.FLY.id], + cloud_providers: [PROVIDERS.AWS.id, PROVIDERS.AWS_K8S.id, PROVIDERS.FLY.id], }, large: { label: 'Large', @@ -55,7 +55,7 @@ export const instanceSizeSpecs: Record< cpu: '2-core', priceHourly: 0.1517, priceMonthly: 110, - cloud_providers: [PROVIDERS.AWS.id, PROVIDERS.AWS_NEW.id, PROVIDERS.FLY.id], + cloud_providers: [PROVIDERS.AWS.id, PROVIDERS.AWS_K8S.id, PROVIDERS.FLY.id], }, xlarge: { label: 'XL', @@ -63,7 +63,7 @@ export const instanceSizeSpecs: Record< cpu: '4-core', priceHourly: 0.2877, priceMonthly: 210, - cloud_providers: [PROVIDERS.AWS.id, PROVIDERS.AWS_NEW.id, PROVIDERS.FLY.id], + cloud_providers: [PROVIDERS.AWS.id, PROVIDERS.AWS_K8S.id, PROVIDERS.FLY.id], }, '2xlarge': { label: '2XL', @@ -71,7 +71,7 @@ export const instanceSizeSpecs: Record< cpu: '8-core', priceHourly: 0.562, priceMonthly: 410, - cloud_providers: [PROVIDERS.AWS.id, PROVIDERS.AWS_NEW.id, PROVIDERS.FLY.id], + cloud_providers: [PROVIDERS.AWS.id, PROVIDERS.AWS_K8S.id, PROVIDERS.FLY.id], }, '4xlarge': { label: '4XL', @@ -79,7 +79,7 @@ export const instanceSizeSpecs: Record< cpu: '16-core', priceHourly: 1.32, priceMonthly: 960, - cloud_providers: [PROVIDERS.AWS.id, PROVIDERS.AWS_NEW.id, PROVIDERS.FLY.id], + cloud_providers: [PROVIDERS.AWS.id, PROVIDERS.AWS_K8S.id, PROVIDERS.FLY.id], }, '8xlarge': { label: '8XL', @@ -87,7 +87,7 @@ export const instanceSizeSpecs: Record< cpu: '32-core', priceHourly: 2.562, priceMonthly: 1870, - cloud_providers: [PROVIDERS.AWS.id, PROVIDERS.AWS_NEW.id], + cloud_providers: [PROVIDERS.AWS.id, PROVIDERS.AWS_K8S.id], }, '12xlarge': { label: '12XL', @@ -95,7 +95,7 @@ export const instanceSizeSpecs: Record< cpu: '48-core', priceHourly: 3.836, priceMonthly: 2800, - cloud_providers: [PROVIDERS.AWS.id, PROVIDERS.AWS_NEW.id], + cloud_providers: [PROVIDERS.AWS.id, PROVIDERS.AWS_K8S.id], }, '16xlarge': { label: '16XL', @@ -103,7 +103,7 @@ export const instanceSizeSpecs: Record< cpu: '64-core', priceHourly: 5.12, priceMonthly: 3730, - cloud_providers: [PROVIDERS.AWS.id, PROVIDERS.AWS_NEW.id], + cloud_providers: [PROVIDERS.AWS.id, PROVIDERS.AWS_K8S.id], }, '24xlarge': { label: '24XL', @@ -111,7 +111,7 @@ export const instanceSizeSpecs: Record< cpu: '96-core', priceHourly: 9.73, priceMonthly: 7100, - cloud_providers: [PROVIDERS.AWS.id, PROVIDERS.AWS_NEW.id], + cloud_providers: [PROVIDERS.AWS.id, PROVIDERS.AWS_K8S.id], }, '24xlarge_optimized_cpu': { label: '24XL - Optimized CPU', @@ -119,7 +119,7 @@ export const instanceSizeSpecs: Record< cpu: '96-core', priceHourly: 8.9, priceMonthly: 6500, - cloud_providers: [PROVIDERS.AWS.id, PROVIDERS.AWS_NEW.id], + cloud_providers: [PROVIDERS.AWS.id, PROVIDERS.AWS_K8S.id], }, '24xlarge_optimized_memory': { label: '24XL - Optimized Memory', @@ -127,7 +127,7 @@ export const instanceSizeSpecs: Record< cpu: '96-core', priceHourly: 13.84, priceMonthly: 10100, - cloud_providers: [PROVIDERS.AWS.id, PROVIDERS.AWS_NEW.id], + cloud_providers: [PROVIDERS.AWS.id, PROVIDERS.AWS_K8S.id], }, '24xlarge_high_memory': { label: '24XL - High Memory', @@ -135,7 +135,7 @@ export const instanceSizeSpecs: Record< cpu: '96-core', priceHourly: 21.91, priceMonthly: 16000, - cloud_providers: [PROVIDERS.AWS.id, PROVIDERS.AWS_NEW.id], + cloud_providers: [PROVIDERS.AWS.id, PROVIDERS.AWS_K8S.id], }, '48xlarge': { label: '48XL', @@ -143,7 +143,7 @@ export const instanceSizeSpecs: Record< cpu: '192-core', priceHourly: 19.47, priceMonthly: 14200, - cloud_providers: [PROVIDERS.AWS.id, PROVIDERS.AWS_NEW.id], + cloud_providers: [PROVIDERS.AWS.id, PROVIDERS.AWS_K8S.id], }, '48xlarge_optimized_cpu': { label: '48XL - Optimized CPU', @@ -151,7 +151,7 @@ export const instanceSizeSpecs: Record< cpu: '192-core', priceHourly: 17.8, priceMonthly: 13000, - cloud_providers: [PROVIDERS.AWS.id, PROVIDERS.AWS_NEW.id], + cloud_providers: [PROVIDERS.AWS.id, PROVIDERS.AWS_K8S.id], }, '48xlarge_optimized_memory': { label: '48XL - Optimized Memory', @@ -159,7 +159,7 @@ export const instanceSizeSpecs: Record< cpu: '192-core', priceHourly: 27.68, priceMonthly: 20200, - cloud_providers: [PROVIDERS.AWS.id, PROVIDERS.AWS_NEW.id], + cloud_providers: [PROVIDERS.AWS.id, PROVIDERS.AWS_K8S.id], }, '48xlarge_high_memory': { label: '48XL - High Memory', @@ -167,6 +167,6 @@ export const instanceSizeSpecs: Record< cpu: '192-core', priceHourly: 43.84, priceMonthly: 32000, - cloud_providers: [PROVIDERS.AWS.id, PROVIDERS.AWS_NEW.id], + cloud_providers: [PROVIDERS.AWS.id, PROVIDERS.AWS_K8S.id], }, } diff --git a/apps/studio/hooks/misc/useSelectedProject.ts b/apps/studio/hooks/misc/useSelectedProject.ts index af95487668487..886bb85f3ae70 100644 --- a/apps/studio/hooks/misc/useSelectedProject.ts +++ b/apps/studio/hooks/misc/useSelectedProject.ts @@ -34,11 +34,11 @@ export function useProjectByRef( }, [project, projects, ref]) } -export const useIsAwsNew = () => { +export const useIsAwsK8s = () => { const project = useSelectedProject() - const isAwsNew = - project?.cloud_provider !== PROVIDERS.AWS.id && project?.cloud_provider !== PROVIDERS.FLY.id - return isAwsNew + const isAwsK8s = project?.cloud_provider === PROVIDERS.AWS_K8S.id + + return isAwsK8s } export const useIsOrioleDb = () => { diff --git a/apps/studio/lib/constants/infrastructure.ts b/apps/studio/lib/constants/infrastructure.ts index f240cc2bb0de3..cfd69d3244e94 100644 --- a/apps/studio/lib/constants/infrastructure.ts +++ b/apps/studio/lib/constants/infrastructure.ts @@ -41,8 +41,8 @@ export const PROVIDERS = { default_region: AWS_REGIONS_DEFAULT, regions: { ...AWS_REGIONS }, }, - AWS_NEW: { - id: 'AWS_NEW', + AWS_K8S: { + id: 'AWS_K8S', name: 'AWS (Revamped)', DEFAULT_SSH_KEY: 'supabase-app-instance', default_region: AWS_REGIONS_DEFAULT, diff --git a/packages/shared-data/regions.ts b/packages/shared-data/regions.ts index 502137957444f..27caf5b26597d 100644 --- a/packages/shared-data/regions.ts +++ b/packages/shared-data/regions.ts @@ -1,4 +1,4 @@ -export type CloudProvider = 'FLY' | 'AWS' | 'AWS_NEW' +export type CloudProvider = 'FLY' | 'AWS' | 'AWS_K8S' export type Region = typeof AWS_REGIONS | typeof FLY_REGIONS export const AWS_REGIONS = {