diff --git a/autogen/main/cluster.tf.tmpl b/autogen/main/cluster.tf.tmpl index 459f4f712c..45c7c8b5d3 100644 --- a/autogen/main/cluster.tf.tmpl +++ b/autogen/main/cluster.tf.tmpl @@ -404,7 +404,7 @@ resource "google_container_cluster" "primary" { {% if autopilot_cluster != true %} dynamic "dns_config" { - for_each = var.cluster_dns_provider == "CLOUD_DNS" ? [1] : [] + for_each = contains(["CLOUD_DNS", "PROVIDER_UNSPECIFIED", "PLATFORM_DEFAULT"], var.cluster_dns_provider) ? [1] : [] content { cluster_dns = var.cluster_dns_provider cluster_dns_scope = var.cluster_dns_scope diff --git a/cluster.tf b/cluster.tf index 3f8c070a61..d5ecb17424 100644 --- a/cluster.tf +++ b/cluster.tf @@ -273,7 +273,7 @@ resource "google_container_cluster" "primary" { } dynamic "dns_config" { - for_each = var.cluster_dns_provider == "CLOUD_DNS" ? [1] : [] + for_each = contains(["CLOUD_DNS", "PROVIDER_UNSPECIFIED", "PLATFORM_DEFAULT"], var.cluster_dns_provider) ? [1] : [] content { cluster_dns = var.cluster_dns_provider cluster_dns_scope = var.cluster_dns_scope diff --git a/modules/beta-private-cluster-update-variant/cluster.tf b/modules/beta-private-cluster-update-variant/cluster.tf index c07a41aa1c..fc53bdc8c6 100644 --- a/modules/beta-private-cluster-update-variant/cluster.tf +++ b/modules/beta-private-cluster-update-variant/cluster.tf @@ -331,7 +331,7 @@ resource "google_container_cluster" "primary" { } dynamic "dns_config" { - for_each = var.cluster_dns_provider == "CLOUD_DNS" ? [1] : [] + for_each = contains(["CLOUD_DNS", "PROVIDER_UNSPECIFIED", "PLATFORM_DEFAULT"], var.cluster_dns_provider) ? [1] : [] content { cluster_dns = var.cluster_dns_provider cluster_dns_scope = var.cluster_dns_scope diff --git a/modules/beta-private-cluster/cluster.tf b/modules/beta-private-cluster/cluster.tf index 830e70a93e..b08ceb0e6e 100644 --- a/modules/beta-private-cluster/cluster.tf +++ b/modules/beta-private-cluster/cluster.tf @@ -331,7 +331,7 @@ resource "google_container_cluster" "primary" { } dynamic "dns_config" { - for_each = var.cluster_dns_provider == "CLOUD_DNS" ? [1] : [] + for_each = contains(["CLOUD_DNS", "PROVIDER_UNSPECIFIED", "PLATFORM_DEFAULT"], var.cluster_dns_provider) ? [1] : [] content { cluster_dns = var.cluster_dns_provider cluster_dns_scope = var.cluster_dns_scope diff --git a/modules/beta-public-cluster-update-variant/cluster.tf b/modules/beta-public-cluster-update-variant/cluster.tf index d0671e557f..a02fee6666 100644 --- a/modules/beta-public-cluster-update-variant/cluster.tf +++ b/modules/beta-public-cluster-update-variant/cluster.tf @@ -331,7 +331,7 @@ resource "google_container_cluster" "primary" { } dynamic "dns_config" { - for_each = var.cluster_dns_provider == "CLOUD_DNS" ? [1] : [] + for_each = contains(["CLOUD_DNS", "PROVIDER_UNSPECIFIED", "PLATFORM_DEFAULT"], var.cluster_dns_provider) ? [1] : [] content { cluster_dns = var.cluster_dns_provider cluster_dns_scope = var.cluster_dns_scope diff --git a/modules/beta-public-cluster/cluster.tf b/modules/beta-public-cluster/cluster.tf index f757f769df..08e372cf19 100644 --- a/modules/beta-public-cluster/cluster.tf +++ b/modules/beta-public-cluster/cluster.tf @@ -331,7 +331,7 @@ resource "google_container_cluster" "primary" { } dynamic "dns_config" { - for_each = var.cluster_dns_provider == "CLOUD_DNS" ? [1] : [] + for_each = contains(["CLOUD_DNS", "PROVIDER_UNSPECIFIED", "PLATFORM_DEFAULT"], var.cluster_dns_provider) ? [1] : [] content { cluster_dns = var.cluster_dns_provider cluster_dns_scope = var.cluster_dns_scope diff --git a/modules/private-cluster-update-variant/cluster.tf b/modules/private-cluster-update-variant/cluster.tf index a6bbfa9b59..01961dfae4 100644 --- a/modules/private-cluster-update-variant/cluster.tf +++ b/modules/private-cluster-update-variant/cluster.tf @@ -273,7 +273,7 @@ resource "google_container_cluster" "primary" { } dynamic "dns_config" { - for_each = var.cluster_dns_provider == "CLOUD_DNS" ? [1] : [] + for_each = contains(["CLOUD_DNS", "PROVIDER_UNSPECIFIED", "PLATFORM_DEFAULT"], var.cluster_dns_provider) ? [1] : [] content { cluster_dns = var.cluster_dns_provider cluster_dns_scope = var.cluster_dns_scope diff --git a/modules/private-cluster/cluster.tf b/modules/private-cluster/cluster.tf index e8eefa20df..d42222f769 100644 --- a/modules/private-cluster/cluster.tf +++ b/modules/private-cluster/cluster.tf @@ -273,7 +273,7 @@ resource "google_container_cluster" "primary" { } dynamic "dns_config" { - for_each = var.cluster_dns_provider == "CLOUD_DNS" ? [1] : [] + for_each = contains(["CLOUD_DNS", "PROVIDER_UNSPECIFIED", "PLATFORM_DEFAULT"], var.cluster_dns_provider) ? [1] : [] content { cluster_dns = var.cluster_dns_provider cluster_dns_scope = var.cluster_dns_scope