Skip to content

Commit 2be9be9

Browse files
authored
feat: ami type for mgmt cluster (#530)
1 parent 2787b59 commit 2be9be9

4 files changed

Lines changed: 26 additions & 0 deletions

File tree

constants/cluster.tsx

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -23,3 +23,12 @@ export const CLUSTER_CHECKS: { [key: string]: { label: string; order: number } }
2323
vault_terraform_apply_check: { label: 'Vault Terraform apply', order: 13 },
2424
users_terraform_apply_check: { label: 'Users Terraform apply', order: 14 },
2525
};
26+
27+
export const AWS_AMI_TYPES = [
28+
'AL2_x86_64',
29+
'AL2_ARM_64',
30+
'BOTTLEROCKET_ARM_64',
31+
'BOTTLEROCKET_x86_64',
32+
'BOTTLEROCKET_ARM_64_NVIDIA',
33+
'BOTTLEROCKET_x86_64_NVIDIA',
34+
];

containers/ClusterForms/shared/SetupForm.tsx

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -32,6 +32,7 @@ import { BISCAY } from '@/constants/colors';
3232
import ControlledNumberInput from '@/components/controlledFields/ControlledNumberInput/ControlledNumberInput';
3333
import { CLOUD_REGION_LABELS, CLUSTER_DOMAIN_LABELS } from '@/constants/installation';
3434
import ControlledSelect from '@/components/controlledFields/ControlledSelect';
35+
import { AWS_AMI_TYPES } from '@/constants/cluster';
3536

3637
const SetupForm: FunctionComponent = () => {
3738
const [selectedRegion, setSelectedRegion] = useState<string>('');
@@ -215,6 +216,20 @@ const SetupForm: FunctionComponent = () => {
215216
}))}
216217
/>
217218
)}
219+
{installType === InstallationType.AWS && (
220+
<ControlledAutocomplete
221+
control={control}
222+
name="amiType"
223+
label="AMI type"
224+
required
225+
rules={{ required: true }}
226+
options={AWS_AMI_TYPES.map((amiType) => ({
227+
label: amiType,
228+
value: amiType,
229+
}))}
230+
defaultValue={AWS_AMI_TYPES[0]}
231+
/>
232+
)}
218233
<ControlledAutocomplete
219234
control={control}
220235
name="instanceSize"

redux/thunks/api.thunk.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -48,6 +48,7 @@ export const createCluster = createAsyncThunk<
4848
type: ClusterType.MANAGEMENT,
4949
force_destroy: values?.forceDestroyTerraform,
5050
node_type: values?.instanceSize,
51+
ami_type: values?.amiType,
5152
node_count: values?.nodeCount,
5253
azure_dns_zone_resource_group: values?.resourceGroup,
5354
git_auth: {

types/redux/index.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -67,6 +67,7 @@ export interface AwsInstallValues {
6767
profile?: string;
6868
domainName?: string;
6969
isValid?: boolean;
70+
amiType?: string;
7071
}
7172

7273
export type AwsClusterValues = AwsInstallValues & ClusterValues & GitValues;

0 commit comments

Comments
 (0)