Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat: Allow conditional creation of node groups to be set within node group definitions #1848

Merged
merged 2 commits into from
Feb 8, 2022
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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)
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I haven't tested this yet, but any changes we make like this should also be propagated to the EKS managed node group and Fargate profile definitions

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Good point, I added the feature to the managed node groups and fargate profiles but did not test it, because I am not using them anywhere


cluster_name = aws_eks_cluster.this[0].name
cluster_ip_family = var.cluster_ip_family

Expand Down