terraform-contour-mirror/modules/pg-incluster/variables.tf

43 lines
1.5 KiB
HCL

# Entity contract for the in-cluster PostgreSQL implementation.
#
# `databases` is BYTE-IDENTICAL to modules/yc-database so a single declaration
# in infrastructure.yaml drives both the Yandex MDB and the in-cluster backend.
# `cluster_id` is kept as a logical key (it also keys database_outputs_map as
# cluster_id:db:user, which the shared k8s-secret module looks up) — for the
# in-cluster backend all databases are created on the provider configured by the
# root unit; default_host/default_port describe that single server.
variable "databases" {
description = "List of databases to create"
type = list(object({
cluster_id = string
database = object({
name = string
host = optional(string, "")
lc_collate = optional(string, "en_US.UTF-8")
lc_type = optional(string, "en_US.UTF-8")
extensions = optional(list(string), [])
})
user = object({
name = string
password_length = optional(number, 32)
password_special = optional(bool, false)
conn_limit = optional(number, 10)
permissions = optional(list(string), [])
})
}))
default = []
}
variable "default_host" {
description = "In-cluster PostgreSQL host to report in outputs when a database does not set its own host (e.g. postgresql.postgresql.svc.cluster.local)."
type = string
default = ""
}
variable "default_port" {
description = "In-cluster PostgreSQL port reported in outputs."
type = number
default = 5432
}