output "infra" { value = var.infra } output "buckets" { value = var.buckets } output "databases" { value = { for name, db in var.databases : name => merge(db, { owner = "${name}_owner" }) } } output "services" { value = var.services } output "service_buckets" { value = { for name, svc in var.services : name => { read_write = [for bucket, access in svc.buckets : bucket if access == "rw"] read_only = [for bucket, access in svc.buckets : bucket if access == "ro"] } if length(svc.buckets) > 0 } } output "service_databases" { value = merge([ for name, svc in var.services : { for db in svc.databases : "${name}-${db}" => { service = name database = db role = "${name}-${db}" owner = "${db}_owner" } } ]...) } output "vault" { value = { address = "http://${var.infra.vault.host}:${var.infra.vault.port}" mount = var.infra.vault.mount database_mount = var.infra.vault.database_mount } } output "silo" { value = { server = "${var.infra.silo.host}:${var.infra.silo.port}" internal_endpoint = "http://${var.infra.silo.internal_host}:${var.infra.silo.internal_port}" admin_user = var.infra.silo.admin_user state_bucket = var.infra.silo.state_bucket backup_bucket = var.infra.silo.backup_bucket } } output "postgres" { value = var.infra.postgres }