Support context interpolation for psc_allowed_consumer_projects in module cloudsql-instance (#3894)
This commit is contained in:
@@ -117,9 +117,10 @@ resource "google_sql_database_instance" "primary" {
|
||||
)
|
||||
content {
|
||||
psc_enabled = true
|
||||
allowed_consumer_projects = (
|
||||
var.network_config.connectivity.psc_allowed_consumer_projects
|
||||
)
|
||||
allowed_consumer_projects = [
|
||||
for p in var.network_config.connectivity.psc_allowed_consumer_projects :
|
||||
lookup(local.ctx.project_ids, p, p)
|
||||
]
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -316,9 +317,10 @@ resource "google_sql_database_instance" "replicas" {
|
||||
)
|
||||
content {
|
||||
psc_enabled = true
|
||||
allowed_consumer_projects = (
|
||||
var.network_config.connectivity.psc_allowed_consumer_projects
|
||||
)
|
||||
allowed_consumer_projects = [
|
||||
for p in var.network_config.connectivity.psc_allowed_consumer_projects :
|
||||
lookup(local.ctx.project_ids, p, p)
|
||||
]
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -392,3 +394,4 @@ resource "google_sql_ssl_cert" "client_certificates" {
|
||||
instance = google_sql_database_instance.primary.name
|
||||
common_name = each.key
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user