Skip to content

Commit

Permalink
Add option to set instance_type on the launch template
Browse files Browse the repository at this point in the history
This allows setting the instance type on the launch template rather than
the EKS Managed node group. This is useful because it is not possible to
change the instance types set on a managed node groups after creation.
The suggested way to work around this is to simply define the instance
type in the launch template.

aws/containers-roadmap#746 (comment)
  • Loading branch information
albgus committed Jul 6, 2023
1 parent 0a17f65 commit 6308009
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 1 deletion.
2 changes: 2 additions & 0 deletions modules/eks-managed-node-group/main.tf
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
8 changes: 7 additions & 1 deletion modules/eks-managed-node-group/variables.tf
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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
}
Expand Down

0 comments on commit 6308009

Please sign in to comment.