Skip to content

Commit

Permalink
dynamic blocks for eks auto config
Browse files Browse the repository at this point in the history
  • Loading branch information
miguelhar committed Dec 13, 2024
1 parent ac2014b commit 743dba1
Showing 1 changed file with 13 additions and 8 deletions.
21 changes: 13 additions & 8 deletions modules/eks/cluster.tf
Original file line number Diff line number Diff line change
Expand Up @@ -54,10 +54,13 @@ resource "aws_eks_cluster" "this" {
}


compute_config {
enabled = var.eks.auto_mode_enabled
node_pools = try(var.eks.compute_config.value.node_pools, null)
node_role_arn = try(aws_iam_role.eks_auto_node_role[0].arn, null)
dynamic "compute_config" {
for_each = var.eks.auto_mode_enabled ? [1] : []
content {
enabled = var.eks.auto_mode_enabled
node_pools = try(var.eks.compute_config.value.node_pools, null)
node_role_arn = try(aws_iam_role.eks_auto_node_role[0].arn, null)
}
}

kubernetes_network_config {
Expand All @@ -68,12 +71,14 @@ resource "aws_eks_cluster" "this" {
}
}

storage_config {
block_storage {
enabled = var.eks.auto_mode_enabled
dynamic "storage_config" {
for_each = var.eks.auto_mode_enabled ? [1] : []
content {
block_storage {
enabled = var.eks.auto_mode_enabled
}
}
}

upgrade_policy {
support_type = "EXTENDED"
}
Expand Down

0 comments on commit 743dba1

Please sign in to comment.