Skip to content

Commit 2a6a57a

Browse files
authored
fix: Correct Auto Mode disable (#3253)
1 parent 29d2a8c commit 2a6a57a

File tree

1 file changed

+6
-13
lines changed

1 file changed

+6
-13
lines changed

main.tf

+6-13
Original file line numberDiff line numberDiff line change
@@ -56,7 +56,7 @@ resource "aws_eks_cluster" "this" {
5656
for_each = length(var.cluster_compute_config) > 0 ? [var.cluster_compute_config] : []
5757

5858
content {
59-
enabled = try(compute_config.value.enabled, null)
59+
enabled = local.auto_mode_enabled
6060
node_pools = local.auto_mode_enabled ? try(compute_config.value.node_pools, []) : null
6161
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
6262
}
@@ -75,12 +75,9 @@ resource "aws_eks_cluster" "this" {
7575
for_each = local.create_outposts_local_cluster ? [] : [1]
7676

7777
content {
78-
dynamic "elastic_load_balancing" {
79-
for_each = local.auto_mode_enabled ? [1] : []
78+
elastic_load_balancing {
8079

81-
content {
82-
enabled = local.auto_mode_enabled
83-
}
80+
enabled = local.auto_mode_enabled
8481
}
8582

8683
ip_family = var.cluster_ip_family
@@ -133,13 +130,9 @@ resource "aws_eks_cluster" "this" {
133130
}
134131
}
135132

136-
dynamic "storage_config" {
137-
for_each = local.auto_mode_enabled ? [1] : []
138-
139-
content {
140-
block_storage {
141-
enabled = local.auto_mode_enabled
142-
}
133+
storage_config {
134+
block_storage {
135+
enabled = local.auto_mode_enabled
143136
}
144137
}
145138

0 commit comments

Comments
 (0)