Skip to content

Commit

Permalink
feat: ami type for mgmt cluster (#530)
Browse files Browse the repository at this point in the history
  • Loading branch information
CristhianF7 authored Jan 30, 2025
1 parent 2787b59 commit 2be9be9
Show file tree
Hide file tree
Showing 4 changed files with 26 additions and 0 deletions.
9 changes: 9 additions & 0 deletions constants/cluster.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -23,3 +23,12 @@ export const CLUSTER_CHECKS: { [key: string]: { label: string; order: number } }
vault_terraform_apply_check: { label: 'Vault Terraform apply', order: 13 },
users_terraform_apply_check: { label: 'Users Terraform apply', order: 14 },
};

export const AWS_AMI_TYPES = [
'AL2_x86_64',
'AL2_ARM_64',
'BOTTLEROCKET_ARM_64',
'BOTTLEROCKET_x86_64',
'BOTTLEROCKET_ARM_64_NVIDIA',
'BOTTLEROCKET_x86_64_NVIDIA',
];
15 changes: 15 additions & 0 deletions containers/ClusterForms/shared/SetupForm.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,7 @@ import { BISCAY } from '@/constants/colors';
import ControlledNumberInput from '@/components/controlledFields/ControlledNumberInput/ControlledNumberInput';
import { CLOUD_REGION_LABELS, CLUSTER_DOMAIN_LABELS } from '@/constants/installation';
import ControlledSelect from '@/components/controlledFields/ControlledSelect';
import { AWS_AMI_TYPES } from '@/constants/cluster';

const SetupForm: FunctionComponent = () => {
const [selectedRegion, setSelectedRegion] = useState<string>('');
Expand Down Expand Up @@ -215,6 +216,20 @@ const SetupForm: FunctionComponent = () => {
}))}
/>
)}
{installType === InstallationType.AWS && (
<ControlledAutocomplete
control={control}
name="amiType"
label="AMI type"
required
rules={{ required: true }}
options={AWS_AMI_TYPES.map((amiType) => ({
label: amiType,
value: amiType,
}))}
defaultValue={AWS_AMI_TYPES[0]}
/>
)}
<ControlledAutocomplete
control={control}
name="instanceSize"
Expand Down
1 change: 1 addition & 0 deletions redux/thunks/api.thunk.ts
Original file line number Diff line number Diff line change
Expand Up @@ -48,6 +48,7 @@ export const createCluster = createAsyncThunk<
type: ClusterType.MANAGEMENT,
force_destroy: values?.forceDestroyTerraform,
node_type: values?.instanceSize,
ami_type: values?.amiType,
node_count: values?.nodeCount,
azure_dns_zone_resource_group: values?.resourceGroup,
git_auth: {
Expand Down
1 change: 1 addition & 0 deletions types/redux/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -67,6 +67,7 @@ export interface AwsInstallValues {
profile?: string;
domainName?: string;
isValid?: boolean;
amiType?: string;
}

export type AwsClusterValues = AwsInstallValues & ClusterValues & GitValues;
Expand Down

0 comments on commit 2be9be9

Please sign in to comment.