Skip to content

Commit

Permalink
feat: Allow conditional creation of node groups to be set within node…
Browse files Browse the repository at this point in the history
… group definitions (#1848)
  • Loading branch information
PhilippMT authored Feb 8, 2022
1 parent 6c6841c commit 665f468
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions node_groups.tf
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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
Expand Down Expand Up @@ -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

Expand Down

0 comments on commit 665f468

Please sign in to comment.