Skip to content

Commit 84b8695

Browse files
authored
chore: transition from AWS_NEW to AWS_K8S (supabase#36625)
* chore: transition from AWS_NEW to AWS_K8S * chore: transition from useIsAwsNew to useIsAwsK8s
1 parent 998a7dd commit 84b8695

File tree

6 files changed

+31
-31
lines changed

6 files changed

+31
-31
lines changed

apps/studio/components/interfaces/ProjectCreation/ProjectCreation.utils.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ import { AWS_REGIONS, FLY_REGIONS } from 'shared-data'
44
export function getAvailableRegions(cloudProvider: CloudProvider): Region {
55
switch (cloudProvider) {
66
case 'AWS':
7-
case 'AWS_NEW':
7+
case 'AWS_K8S':
88
return AWS_REGIONS
99
case 'FLY':
1010
return FLY_REGIONS

apps/studio/components/interfaces/Settings/General/Infrastructure/PauseProjectButton.tsx

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@ import { useProjectPauseMutation } from 'data/projects/project-pause-mutation'
1414
import { setProjectStatus } from 'data/projects/projects-query'
1515
import { useCheckPermissions } from 'hooks/misc/useCheckPermissions'
1616
import { useSelectedOrganization } from 'hooks/misc/useSelectedOrganization'
17-
import { useIsAwsNew } from 'hooks/misc/useSelectedProject'
17+
import { useIsAwsK8s } from 'hooks/misc/useSelectedProject'
1818
import { PROJECT_STATUS } from 'lib/constants'
1919
import ConfirmationModal from 'ui-patterns/Dialogs/ConfirmationModal'
2020

@@ -33,9 +33,9 @@ const PauseProjectButton = () => {
3333
'queue_jobs.projects.pause'
3434
)
3535

36-
const isAwsNew = useIsAwsNew()
36+
const isAwsK8s = useIsAwsK8s()
3737
const isFreePlan = organization?.plan.id === 'free'
38-
const isPaidAndNotAwsNew = !isFreePlan && !isAwsNew
38+
const isPaidAndNotAwsK8s = !isFreePlan && !isAwsK8s
3939

4040
const { mutate: pauseProject, isLoading: isPausing } = useProjectPauseMutation({
4141
onSuccess: (_, variables) => {
@@ -53,7 +53,7 @@ const PauseProjectButton = () => {
5353
}
5454

5555
const buttonDisabled =
56-
isPaidAndNotAwsNew || project === undefined || isPaused || !canPauseProject || !isProjectActive
56+
isPaidAndNotAwsK8s || project === undefined || isPaused || !canPauseProject || !isProjectActive
5757

5858
return (
5959
<>
@@ -72,7 +72,7 @@ const PauseProjectButton = () => {
7272
? 'You need additional permissions to pause this project'
7373
: !isProjectActive
7474
? 'Unable to pause project as project is not active'
75-
: isPaidAndNotAwsNew
75+
: isPaidAndNotAwsK8s
7676
? 'Projects on a paid plan will always be running'
7777
: undefined,
7878
},

apps/studio/data/projects/new-project.constants.ts

Lines changed: 18 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -31,142 +31,142 @@ export const instanceSizeSpecs: Record<
3131
cpu: '2-core',
3232
priceHourly: 0.01344,
3333
priceMonthly: 10,
34-
cloud_providers: [PROVIDERS.AWS.id, PROVIDERS.AWS_NEW.id, PROVIDERS.FLY.id],
34+
cloud_providers: [PROVIDERS.AWS.id, PROVIDERS.AWS_K8S.id, PROVIDERS.FLY.id],
3535
},
3636
small: {
3737
label: 'Small',
3838
ram: '2 GB',
3939
cpu: '2-core',
4040
priceHourly: 0.0206,
4141
priceMonthly: 15,
42-
cloud_providers: [PROVIDERS.AWS.id, PROVIDERS.AWS_NEW.id, PROVIDERS.FLY.id],
42+
cloud_providers: [PROVIDERS.AWS.id, PROVIDERS.AWS_K8S.id, PROVIDERS.FLY.id],
4343
},
4444
medium: {
4545
label: 'Medium',
4646
ram: '4 GB',
4747
cpu: '2-core',
4848
priceHourly: 0.0822,
4949
priceMonthly: 60,
50-
cloud_providers: [PROVIDERS.AWS.id, PROVIDERS.AWS_NEW.id, PROVIDERS.FLY.id],
50+
cloud_providers: [PROVIDERS.AWS.id, PROVIDERS.AWS_K8S.id, PROVIDERS.FLY.id],
5151
},
5252
large: {
5353
label: 'Large',
5454
ram: '8 GB',
5555
cpu: '2-core',
5656
priceHourly: 0.1517,
5757
priceMonthly: 110,
58-
cloud_providers: [PROVIDERS.AWS.id, PROVIDERS.AWS_NEW.id, PROVIDERS.FLY.id],
58+
cloud_providers: [PROVIDERS.AWS.id, PROVIDERS.AWS_K8S.id, PROVIDERS.FLY.id],
5959
},
6060
xlarge: {
6161
label: 'XL',
6262
ram: '16 GB',
6363
cpu: '4-core',
6464
priceHourly: 0.2877,
6565
priceMonthly: 210,
66-
cloud_providers: [PROVIDERS.AWS.id, PROVIDERS.AWS_NEW.id, PROVIDERS.FLY.id],
66+
cloud_providers: [PROVIDERS.AWS.id, PROVIDERS.AWS_K8S.id, PROVIDERS.FLY.id],
6767
},
6868
'2xlarge': {
6969
label: '2XL',
7070
ram: '32 GB',
7171
cpu: '8-core',
7272
priceHourly: 0.562,
7373
priceMonthly: 410,
74-
cloud_providers: [PROVIDERS.AWS.id, PROVIDERS.AWS_NEW.id, PROVIDERS.FLY.id],
74+
cloud_providers: [PROVIDERS.AWS.id, PROVIDERS.AWS_K8S.id, PROVIDERS.FLY.id],
7575
},
7676
'4xlarge': {
7777
label: '4XL',
7878
ram: '64 GB',
7979
cpu: '16-core',
8080
priceHourly: 1.32,
8181
priceMonthly: 960,
82-
cloud_providers: [PROVIDERS.AWS.id, PROVIDERS.AWS_NEW.id, PROVIDERS.FLY.id],
82+
cloud_providers: [PROVIDERS.AWS.id, PROVIDERS.AWS_K8S.id, PROVIDERS.FLY.id],
8383
},
8484
'8xlarge': {
8585
label: '8XL',
8686
ram: '128 GB',
8787
cpu: '32-core',
8888
priceHourly: 2.562,
8989
priceMonthly: 1870,
90-
cloud_providers: [PROVIDERS.AWS.id, PROVIDERS.AWS_NEW.id],
90+
cloud_providers: [PROVIDERS.AWS.id, PROVIDERS.AWS_K8S.id],
9191
},
9292
'12xlarge': {
9393
label: '12XL',
9494
ram: '192 GB',
9595
cpu: '48-core',
9696
priceHourly: 3.836,
9797
priceMonthly: 2800,
98-
cloud_providers: [PROVIDERS.AWS.id, PROVIDERS.AWS_NEW.id],
98+
cloud_providers: [PROVIDERS.AWS.id, PROVIDERS.AWS_K8S.id],
9999
},
100100
'16xlarge': {
101101
label: '16XL',
102102
ram: '256 GB',
103103
cpu: '64-core',
104104
priceHourly: 5.12,
105105
priceMonthly: 3730,
106-
cloud_providers: [PROVIDERS.AWS.id, PROVIDERS.AWS_NEW.id],
106+
cloud_providers: [PROVIDERS.AWS.id, PROVIDERS.AWS_K8S.id],
107107
},
108108
'24xlarge': {
109109
label: '24XL',
110110
ram: '384 GB',
111111
cpu: '96-core',
112112
priceHourly: 9.73,
113113
priceMonthly: 7100,
114-
cloud_providers: [PROVIDERS.AWS.id, PROVIDERS.AWS_NEW.id],
114+
cloud_providers: [PROVIDERS.AWS.id, PROVIDERS.AWS_K8S.id],
115115
},
116116
'24xlarge_optimized_cpu': {
117117
label: '24XL - Optimized CPU',
118118
ram: '192 GB',
119119
cpu: '96-core',
120120
priceHourly: 8.9,
121121
priceMonthly: 6500,
122-
cloud_providers: [PROVIDERS.AWS.id, PROVIDERS.AWS_NEW.id],
122+
cloud_providers: [PROVIDERS.AWS.id, PROVIDERS.AWS_K8S.id],
123123
},
124124
'24xlarge_optimized_memory': {
125125
label: '24XL - Optimized Memory',
126126
ram: '768 GB',
127127
cpu: '96-core',
128128
priceHourly: 13.84,
129129
priceMonthly: 10100,
130-
cloud_providers: [PROVIDERS.AWS.id, PROVIDERS.AWS_NEW.id],
130+
cloud_providers: [PROVIDERS.AWS.id, PROVIDERS.AWS_K8S.id],
131131
},
132132
'24xlarge_high_memory': {
133133
label: '24XL - High Memory',
134134
ram: '1536 GB',
135135
cpu: '96-core',
136136
priceHourly: 21.91,
137137
priceMonthly: 16000,
138-
cloud_providers: [PROVIDERS.AWS.id, PROVIDERS.AWS_NEW.id],
138+
cloud_providers: [PROVIDERS.AWS.id, PROVIDERS.AWS_K8S.id],
139139
},
140140
'48xlarge': {
141141
label: '48XL',
142142
ram: '768 GB',
143143
cpu: '192-core',
144144
priceHourly: 19.47,
145145
priceMonthly: 14200,
146-
cloud_providers: [PROVIDERS.AWS.id, PROVIDERS.AWS_NEW.id],
146+
cloud_providers: [PROVIDERS.AWS.id, PROVIDERS.AWS_K8S.id],
147147
},
148148
'48xlarge_optimized_cpu': {
149149
label: '48XL - Optimized CPU',
150150
ram: '384 GB',
151151
cpu: '192-core',
152152
priceHourly: 17.8,
153153
priceMonthly: 13000,
154-
cloud_providers: [PROVIDERS.AWS.id, PROVIDERS.AWS_NEW.id],
154+
cloud_providers: [PROVIDERS.AWS.id, PROVIDERS.AWS_K8S.id],
155155
},
156156
'48xlarge_optimized_memory': {
157157
label: '48XL - Optimized Memory',
158158
ram: '1536 GB',
159159
cpu: '192-core',
160160
priceHourly: 27.68,
161161
priceMonthly: 20200,
162-
cloud_providers: [PROVIDERS.AWS.id, PROVIDERS.AWS_NEW.id],
162+
cloud_providers: [PROVIDERS.AWS.id, PROVIDERS.AWS_K8S.id],
163163
},
164164
'48xlarge_high_memory': {
165165
label: '48XL - High Memory',
166166
ram: '3072 GB',
167167
cpu: '192-core',
168168
priceHourly: 43.84,
169169
priceMonthly: 32000,
170-
cloud_providers: [PROVIDERS.AWS.id, PROVIDERS.AWS_NEW.id],
170+
cloud_providers: [PROVIDERS.AWS.id, PROVIDERS.AWS_K8S.id],
171171
},
172172
}

apps/studio/hooks/misc/useSelectedProject.ts

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -34,11 +34,11 @@ export function useProjectByRef(
3434
}, [project, projects, ref])
3535
}
3636

37-
export const useIsAwsNew = () => {
37+
export const useIsAwsK8s = () => {
3838
const project = useSelectedProject()
39-
const isAwsNew =
40-
project?.cloud_provider !== PROVIDERS.AWS.id && project?.cloud_provider !== PROVIDERS.FLY.id
41-
return isAwsNew
39+
const isAwsK8s = project?.cloud_provider === PROVIDERS.AWS_K8S.id
40+
41+
return isAwsK8s
4242
}
4343

4444
export const useIsOrioleDb = () => {

apps/studio/lib/constants/infrastructure.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -41,8 +41,8 @@ export const PROVIDERS = {
4141
default_region: AWS_REGIONS_DEFAULT,
4242
regions: { ...AWS_REGIONS },
4343
},
44-
AWS_NEW: {
45-
id: 'AWS_NEW',
44+
AWS_K8S: {
45+
id: 'AWS_K8S',
4646
name: 'AWS (Revamped)',
4747
DEFAULT_SSH_KEY: 'supabase-app-instance',
4848
default_region: AWS_REGIONS_DEFAULT,

packages/shared-data/regions.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
export type CloudProvider = 'FLY' | 'AWS' | 'AWS_NEW'
1+
export type CloudProvider = 'FLY' | 'AWS' | 'AWS_K8S'
22
export type Region = typeof AWS_REGIONS | typeof FLY_REGIONS
33

44
export const AWS_REGIONS = {

0 commit comments

Comments
 (0)