Skip to content

Commit

Permalink
fix: Correct Auto Mode disable (#3253)
Browse files Browse the repository at this point in the history
  • Loading branch information
bryantbiggs authored Dec 20, 2024
1 parent 29d2a8c commit 2a6a57a
Showing 1 changed file with 6 additions and 13 deletions.
19 changes: 6 additions & 13 deletions main.tf
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,7 @@ resource "aws_eks_cluster" "this" {
for_each = length(var.cluster_compute_config) > 0 ? [var.cluster_compute_config] : []

content {
enabled = try(compute_config.value.enabled, null)
enabled = local.auto_mode_enabled
node_pools = local.auto_mode_enabled ? try(compute_config.value.node_pools, []) : null
node_role_arn = local.auto_mode_enabled && length(try(compute_config.value.node_pools, [])) > 0 ? try(compute_config.value.node_role_arn, aws_iam_role.eks_auto[0].arn, null) : null
}
Expand All @@ -75,12 +75,9 @@ resource "aws_eks_cluster" "this" {
for_each = local.create_outposts_local_cluster ? [] : [1]

content {
dynamic "elastic_load_balancing" {
for_each = local.auto_mode_enabled ? [1] : []
elastic_load_balancing {

content {
enabled = local.auto_mode_enabled
}
enabled = local.auto_mode_enabled
}

ip_family = var.cluster_ip_family
Expand Down Expand Up @@ -133,13 +130,9 @@ resource "aws_eks_cluster" "this" {
}
}

dynamic "storage_config" {
for_each = local.auto_mode_enabled ? [1] : []

content {
block_storage {
enabled = local.auto_mode_enabled
}
storage_config {
block_storage {
enabled = local.auto_mode_enabled
}
}

Expand Down

0 comments on commit 2a6a57a

Please sign in to comment.