From fd546e00f19b98e16e2fbc65e945ae33ede31058 Mon Sep 17 00:00:00 2001 From: = Date: Sun, 6 Feb 2022 19:02:25 +0100 Subject: [PATCH 1/2] Allow conditional creation of self_managed_node_group by passing create to the module --- node_groups.tf | 2 ++ 1 file changed, 2 insertions(+) diff --git a/node_groups.tf b/node_groups.tf index 0381005a24..f541065fe4 100644 --- a/node_groups.tf +++ b/node_groups.tf @@ -331,6 +331,8 @@ module "self_managed_node_group" { for_each = { for k, v in var.self_managed_node_groups : k => v if var.create } + create = try(each.value.create, true) + cluster_name = aws_eks_cluster.this[0].name cluster_ip_family = var.cluster_ip_family From d2ccaba8bb332bb28488ff224aa868d71f46ef1e Mon Sep 17 00:00:00 2001 From: PhilippMT <60776105+PhilippMT@users.noreply.github.com> Date: Mon, 7 Feb 2022 22:00:47 +0100 Subject: [PATCH 2/2] Allow to disable creation of individual fargate_profiles and eks_managed_node_groups map entries --- node_groups.tf | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/node_groups.tf b/node_groups.tf index f541065fe4..68ef4e87ea 100644 --- a/node_groups.tf +++ b/node_groups.tf @@ -194,6 +194,8 @@ module "fargate_profile" { for_each = { for k, v in var.fargate_profiles : k => v if var.create } + create = try(each.value.create, true) + # Fargate Profile cluster_name = aws_eks_cluster.this[0].name cluster_ip_family = var.cluster_ip_family @@ -226,6 +228,8 @@ module "eks_managed_node_group" { for_each = { for k, v in var.eks_managed_node_groups : k => v if var.create } + create = try(each.value.create, true) + cluster_name = aws_eks_cluster.this[0].name cluster_version = try(each.value.cluster_version, var.eks_managed_node_group_defaults.cluster_version, var.cluster_version) cluster_security_group_id = local.cluster_security_group_id