From 581319f31e9262629ee4f1b59eee9c10ce9106c4 Mon Sep 17 00:00:00 2001 From: baibailiha Date: Thu, 10 Aug 2023 20:11:48 +0800 Subject: [PATCH] feat: Allow conditional creation of node groups to be set within node group definitions (#1848) --- node_groups.tf | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/node_groups.tf b/node_groups.tf index 0381005..68ef4e8 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 @@ -331,6 +335,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