diff --git a/main.tf b/main.tf index ee1bcaf9..d9e7c32f 100644 --- a/main.tf +++ b/main.tf @@ -212,6 +212,12 @@ resource "google_compute_backend_service" "default" { # To achieve a null backend security_policy, set each.value.security_policy to "" (empty string), otherwise, it fallsback to var.security_policy. security_policy = each.value["security_policy"] == "" ? null : (each.value["security_policy"] == null ? var.security_policy : each.value.security_policy) + iap { + enabled = lookup(lookup(each.value, "iap_config", {}), "enable", false) + oauth2_client_id = lookup(lookup(each.value, "iap_config", {}), "oauth2_client_id", null) + oauth2_client_secret = lookup(lookup(each.value, "iap_config", {}), "oauth2_client_secret", null) + } + dynamic "backend" { for_each = toset(each.value["groups"]) content { @@ -238,14 +244,6 @@ resource "google_compute_backend_service" "default" { } } - dynamic "iap" { - for_each = lookup(lookup(each.value, "iap_config", {}), "enable", false) ? [1] : [] - content { - oauth2_client_id = lookup(lookup(each.value, "iap_config", {}), "oauth2_client_id", "") - oauth2_client_secret = lookup(lookup(each.value, "iap_config", {}), "oauth2_client_secret", "") - } - } - dynamic "cdn_policy" { for_each = each.value.enable_cdn ? [1] : [] content { diff --git a/modules/dynamic_backends/versions.tf b/modules/dynamic_backends/versions.tf index f51e5343..9f525974 100644 --- a/modules/dynamic_backends/versions.tf +++ b/modules/dynamic_backends/versions.tf @@ -20,11 +20,11 @@ terraform { google = { source = "hashicorp/google" - version = ">= 4.84, < 6" + version = ">= 4.84, < 7" } google-beta = { source = "hashicorp/google-beta" - version = ">= 4.84, < 6" + version = ">= 4.84, < 7" } random = { source = "hashicorp/random" diff --git a/modules/serverless_negs/versions.tf b/modules/serverless_negs/versions.tf index 738a6e66..cc696e4a 100644 --- a/modules/serverless_negs/versions.tf +++ b/modules/serverless_negs/versions.tf @@ -20,11 +20,11 @@ terraform { google = { source = "hashicorp/google" - version = ">= 4.84, < 6" + version = ">= 4.84, < 7" } google-beta = { source = "hashicorp/google-beta" - version = ">= 4.84, < 6" + version = ">= 4.84, < 7" } random = { source = "hashicorp/random" diff --git a/versions.tf b/versions.tf index 3040dda6..7c61f376 100644 --- a/versions.tf +++ b/versions.tf @@ -20,11 +20,11 @@ terraform { google = { source = "hashicorp/google" - version = ">= 4.84, < 6" + version = ">= 4.84, < 7" } google-beta = { source = "hashicorp/google-beta" - version = ">= 4.84, < 6" + version = ">= 4.84, < 7" } random = { source = "hashicorp/random"