From 0befae3654b01840b3fb922e757236f0b96a3410 Mon Sep 17 00:00:00 2001 From: Sungho Spark Date: Fri, 25 Jun 2021 11:10:52 -0700 Subject: [PATCH] compact the worker security group to remove empty group id --- modules/node_groups/launch_template.tf | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/modules/node_groups/launch_template.tf b/modules/node_groups/launch_template.tf index bdd05b3a2c..29c944b7f6 100644 --- a/modules/node_groups/launch_template.tf +++ b/modules/node_groups/launch_template.tf @@ -48,7 +48,7 @@ resource "aws_launch_template" "workers" { network_interfaces { associate_public_ip_address = lookup(each.value, "public_ip", null) delete_on_termination = lookup(each.value, "eni_delete", null) - security_groups = flatten([ + security_groups = compact(flatten([ var.worker_security_group_id, var.worker_additional_security_group_ids, lookup( @@ -56,7 +56,7 @@ resource "aws_launch_template" "workers" { "additional_security_group_ids", null, ), - ]) + ])) } # if you want to use a custom AMI