From 01d833aaac27cad477b5e60528546e7988e8e690 Mon Sep 17 00:00:00 2001 From: philoj Date: Wed, 9 Apr 2025 11:52:16 +0530 Subject: [PATCH] Fix read-replica psc_enabled change never set --- modules/postgresql/read_replica.tf | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/modules/postgresql/read_replica.tf b/modules/postgresql/read_replica.tf index c4fce644..516b308e 100644 --- a/modules/postgresql/read_replica.tf +++ b/modules/postgresql/read_replica.tf @@ -64,10 +64,10 @@ resource "google_sql_database_instance" "replicas" { } } dynamic "psc_config" { - for_each = ip_configuration.value.psc_enabled ? ["psc_enabled"] : [] + for_each = ip_configuration.value.psc_enabled ? ["psc_enabled"] : ["psc_disabled"] content { psc_enabled = ip_configuration.value.psc_enabled - allowed_consumer_projects = ip_configuration.value.psc_allowed_consumer_projects + allowed_consumer_projects = ip_configuration.value.psc_enabled ? ip_configuration.value.psc_allowed_consumer_projects : [] } } }