Skip to content

Commit

Permalink
feat: Supporting update_config in EKS managed node groups (#1554)
Browse files Browse the repository at this point in the history
  • Loading branch information
Mariano Billinghurst committed Sep 1, 2021
1 parent 979d62d commit 46a2136
Show file tree
Hide file tree
Showing 2 changed files with 16 additions and 0 deletions.
2 changes: 2 additions & 0 deletions examples/managed_node_groups/main.tf
Original file line number Diff line number Diff line change
Expand Up @@ -95,6 +95,8 @@ module "eks" {
effect = "NO_SCHEDULE"
}
]
max_unavailable_type = "percent"
max_unavailable = 50
}
}

Expand Down
14 changes: 14 additions & 0 deletions modules/node_groups/node_groups.tf
Original file line number Diff line number Diff line change
Expand Up @@ -69,6 +69,20 @@ resource "aws_eks_node_group" "workers" {
}
}

dynamic "update_config" {
for_each = each.value["max_unavailable_type"] == "number" ? toset([each.value["max_unavailable"]]) : toset([])
content {
max_unavailable = update_config.value
}
}

dynamic "update_config" {
for_each = each.value["max_unavailable_type"] == "percent" ? toset([each.value["max_unavailable"]]) : toset([])
content {
max_unavailable_percentage = update_config.value
}
}

version = lookup(each.value, "version", null)

labels = merge(
Expand Down

0 comments on commit 46a2136

Please sign in to comment.