From 571da60aea10034cef20c435c2b49933ab5ede47 Mon Sep 17 00:00:00 2001 From: "Thierno IB. BARRY" Date: Sat, 7 Nov 2020 22:29:24 +0100 Subject: [PATCH] fix: Change the default `launch_template_id` to `null` for Managed Node Groups (#1088) --- local.tf | 2 +- modules/node_groups/node_groups.tf | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/local.tf b/local.tf index 7e649a4..bb23a63 100644 --- a/local.tf +++ b/local.tf @@ -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. diff --git a/modules/node_groups/node_groups.tf b/modules/node_groups/node_groups.tf index ba7e265..0cd2594 100644 --- a/modules/node_groups/node_groups.tf +++ b/modules/node_groups/node_groups.tf @@ -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" { @@ -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"] }] : []