diff --git a/modules/eks-managed-node-group/main.tf b/modules/eks-managed-node-group/main.tf index 1d3fe81698..035b428d6c 100644 --- a/modules/eks-managed-node-group/main.tf +++ b/modules/eks-managed-node-group/main.tf @@ -170,6 +170,8 @@ resource "aws_launch_template" "this" { } } + instance_type = var.instance_type + # # Set on node group instead # instance_type = var.launch_template_instance_type kernel_id = var.kernel_id diff --git a/modules/eks-managed-node-group/variables.tf b/modules/eks-managed-node-group/variables.tf index 197cd28c95..161d940750 100644 --- a/modules/eks-managed-node-group/variables.tf +++ b/modules/eks-managed-node-group/variables.tf @@ -222,6 +222,12 @@ variable "instance_market_options" { default = {} } +variable "instance_type" { + description = "Set of instance type associated with the Launch Template. Conflicts with `instance_types`" + type = string + default = null +} + variable "maintenance_options" { description = "The maintenance options for the instance" type = any @@ -351,7 +357,7 @@ variable "force_update_version" { } variable "instance_types" { - description = "Set of instance types associated with the EKS Node Group. Defaults to `[\"t3.medium\"]`" + description = "Set of instance types associated with the EKS Node Group. Defaults to `[\"t3.medium\"]`. Conflicts with `instance_types`" type = list(string) default = null } diff --git a/node_groups.tf b/node_groups.tf index db78861a81..96bf0ca799 100644 --- a/node_groups.tf +++ b/node_groups.tf @@ -341,6 +341,7 @@ module "eks_managed_node_group" { elastic_inference_accelerator = try(each.value.elastic_inference_accelerator, var.eks_managed_node_group_defaults.elastic_inference_accelerator, {}) enclave_options = try(each.value.enclave_options, var.eks_managed_node_group_defaults.enclave_options, {}) instance_market_options = try(each.value.instance_market_options, var.eks_managed_node_group_defaults.instance_market_options, {}) + instance_type = try(each.value.instance_type, var.eks_managed_node_group_defaults.instance_type, null) license_specifications = try(each.value.license_specifications, var.eks_managed_node_group_defaults.license_specifications, {}) metadata_options = try(each.value.metadata_options, var.eks_managed_node_group_defaults.metadata_options, local.metadata_options) enable_monitoring = try(each.value.enable_monitoring, var.eks_managed_node_group_defaults.enable_monitoring, true)