terraform-contour-mirror/modules/yc-database/outputs.tf
2026-01-28 13:19:41 +03:00

28 lines
1.0 KiB
HCL

output "databases" {
description = "Map of created databases (cluster_id:db_name:user_name => data)"
value = {
for key, db in local.databases_map : key => {
cluster_id = db.cluster_id
host = try(data.yandex_mdb_postgresql_cluster.existing[db.cluster_id].host[0].fqdn, "")
port = 6432
database_name = yandex_mdb_postgresql_database.this[key].name
user_name = yandex_mdb_postgresql_user.this[key].name
password = random_password.user_password[key].result
}
}
sensitive = true
}
output "database_outputs_map" {
description = "Map for secrets module (cluster_id:db_name:user_name => credentials)"
value = {
for key, db in local.databases_map : key => {
host = try(data.yandex_mdb_postgresql_cluster.existing[db.cluster_id].host[0].fqdn, "")
database_name = yandex_mdb_postgresql_database.this[key].name
user_name = yandex_mdb_postgresql_user.this[key].name
password = random_password.user_password[key].result
}
}
sensitive = true
}