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
baibailiha authored Aug 10, 2023
1 parent 4ff2cd8 commit 581319f
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 581319f

Please sign in to comment.