mirror of
https://gitlab.sarex.io/infra/terraform-contour-mirror.git
synced 2026-08-05 18:31:00 +03:00
31 lines
1.2 KiB
HCL
31 lines
1.2 KiB
HCL
# Output shape byte-identical to modules/yc-database so k8s-secret consumes it
|
|
# unchanged. host = the database's own host or the module default (in-cluster svc).
|
|
|
|
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(db.database.host, "") != "" ? db.database.host : var.default_host
|
|
port = var.default_port
|
|
database_name = postgresql_database.this[key].name
|
|
user_name = postgresql_role.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(db.database.host, "") != "" ? db.database.host : var.default_host
|
|
database_name = postgresql_database.this[key].name
|
|
user_name = postgresql_role.this[key].name
|
|
password = random_password.user_password[key].result
|
|
}
|
|
}
|
|
sensitive = true
|
|
}
|