Skip to content

Commit a5d1b7b

Browse files
satrayarikoptic
authored andcommitted
enh: allow multiple instance types for aws
This was squashed with the commit for fix: change check for multiple instance types and while rebasing we had a conflict for src/_nebari/stages/infrastructure/template/aws/modules/kubernetes/main.tf Annotation for our "manual patch queue": PR: #3070
1 parent fd035e3 commit a5d1b7b

File tree

2 files changed

+6
-5
lines changed

2 files changed

+6
-5
lines changed

src/_nebari/stages/infrastructure/__init__.py

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -619,10 +619,11 @@ def _check_input(cls, data: Any) -> Any:
619619
if hasattr(node_group, "__getitem__")
620620
else node_group.instance
621621
)
622-
if instance not in available_instances:
623-
raise ValueError(
624-
f"Amazon Web Services instance {node_group.instance} not one of available instance types={available_instances}"
625-
)
622+
for instance_name in instance.split(","):
623+
if instance_name not in available_instances:
624+
raise ValueError(
625+
f"Amazon Web Services instance {instance_name} not one of available instance types={available_instances}"
626+
)
626627

627628
# check if kms key is valid
628629
available_kms_keys = amazon_web_services.kms_key_arns(data["region"])

src/_nebari/stages/infrastructure/template/aws/modules/kubernetes/main.tf

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -91,7 +91,7 @@ resource "aws_eks_node_group" "main" {
9191
node_role_arn = aws_iam_role.node-group.arn
9292
subnet_ids = var.node_groups[count.index].single_subnet ? [element(var.cluster_subnets, 0)] : var.cluster_subnets
9393

94-
instance_types = [var.node_groups[count.index].instance_type]
94+
instance_types = split(",", var.node_groups[count.index].instance_type)
9595
capacity_type = var.node_groups[count.index].spot ? "SPOT" : "ON_DEMAND"
9696
ami_type = var.node_groups[count.index].ami_type
9797
disk_size = var.node_groups[count.index].launch_template == null ? 50 : null

0 commit comments

Comments
 (0)