Skip to content

Commit

Permalink
fix: Change the default launch_template_id to null for Managed No…
Browse files Browse the repository at this point in the history
…de Groups (#1088)
  • Loading branch information
barryib authored Nov 7, 2020
1 parent bba7c15 commit 571da60
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
2 changes: 1 addition & 1 deletion local.tf
Original file line number Diff line number Diff line change
Expand Up @@ -71,7 +71,7 @@ locals {
# Settings for launch templates
root_block_device_name = data.aws_ami.eks_worker.root_device_name # Root device name for workers. If non is provided, will assume default AMI was used.
root_kms_key_id = "" # The KMS key to use when encrypting the root storage device
launch_template_id = "" # The id of the launch template used for managed node_groups
launch_template_id = null # The id of the launch template used for managed node_groups
launch_template_version = "$Latest" # The lastest version of the launch template to use in the autoscaling group
launch_template_placement_tenancy = "default" # The placement tenancy for instances
launch_template_placement_group = null # The name of the placement group into which to launch the instances, if any.
Expand Down
4 changes: 2 additions & 2 deletions modules/node_groups/node_groups.tf
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ resource "aws_eks_node_group" "workers" {

ami_type = lookup(each.value, "ami_type", null)
disk_size = lookup(each.value, "disk_size", null)
instance_types = each.value["launch_template_id"] != "" ? [] : [each.value["instance_type"]]
instance_types = each.value["launch_template_id"] != null ? [] : [each.value["instance_type"]]
release_version = lookup(each.value, "ami_release_version", null)

dynamic "remote_access" {
Expand All @@ -31,7 +31,7 @@ resource "aws_eks_node_group" "workers" {
}

dynamic "launch_template" {
for_each = each.value["launch_template_id"] != "" ? [{
for_each = each.value["launch_template_id"] != null ? [{
id = each.value["launch_template_id"]
version = each.value["launch_template_version"]
}] : []
Expand Down

0 comments on commit 571da60

Please sign in to comment.