diff --git a/main.tf b/main.tf index 18933422f5..562e9d9495 100644 --- a/main.tf +++ b/main.tf @@ -53,7 +53,7 @@ resource "aws_eks_cluster" "this" { } dynamic "compute_config" { - for_each = length(var.cluster_compute_config) > 0 ? [var.cluster_compute_config] : [] + for_each = local.auto_mode_enabled ? [var.cluster_compute_config] : [] content { enabled = local.auto_mode_enabled diff --git a/variables.tf b/variables.tf index 855c2133ec..91ad761ec6 100644 --- a/variables.tf +++ b/variables.tf @@ -47,6 +47,7 @@ variable "authentication_mode" { variable "cluster_compute_config" { description = "Configuration block for the cluster compute configuration" type = any + nullable = false default = {} }