mirror of
https://gitlab.sarex.io/infra/terraform-contour-mirror.git
synced 2026-08-05 18:31:00 +03:00
79 lines
2.4 KiB
HCL
79 lines
2.4 KiB
HCL
variable "environment" {
|
|
description = "Target environment name, for example stage/preprod/prod."
|
|
type = string
|
|
}
|
|
|
|
variable "topics" {
|
|
description = "Kafka topics declared in infrastructure.yaml under environments.<env>.kafka.topics."
|
|
type = list(object({
|
|
name = string
|
|
owner = string
|
|
clusterRef = string
|
|
partitions = any
|
|
replicationFactor = any
|
|
config = optional(any, {})
|
|
inheritDefaultConfig = optional(bool, true)
|
|
deletionPolicy = optional(string, "orphan")
|
|
ownerRoles = optional(list(string))
|
|
}))
|
|
default = []
|
|
}
|
|
|
|
variable "users" {
|
|
description = "User-centric Kafka access declarations from infrastructure.yaml under environments.<env>.kafka.users."
|
|
type = list(object({
|
|
name = string
|
|
clusterRef = string
|
|
adoptExisting = optional(bool, false)
|
|
permissions = optional(list(object({
|
|
topic = string
|
|
roles = list(string)
|
|
})), [])
|
|
}))
|
|
default = []
|
|
}
|
|
|
|
variable "kafka_cluster_refs" {
|
|
description = "Environment clusterRef mapping from infrastructure.yaml."
|
|
type = map(object({
|
|
cluster_id = string
|
|
host = optional(string, "")
|
|
port = optional(number, 9091)
|
|
sasl_mechanism = optional(string, "SCRAM-SHA-512")
|
|
security_protocol = optional(string, "SASL_SSL")
|
|
default_partitions = optional(number, 3)
|
|
default_replication_factor = optional(number, 1)
|
|
max_replication_factor = optional(number, 1)
|
|
default_topic_config = optional(map(string), {})
|
|
}))
|
|
}
|
|
|
|
variable "kafka_policy" {
|
|
description = "Platform policy for service-owned Kafka declarations."
|
|
type = object({
|
|
allow_create = optional(bool, true)
|
|
allow_delete = optional(bool, false)
|
|
allow_partition_increase = optional(bool, true)
|
|
allow_partition_decrease = optional(bool, false)
|
|
})
|
|
default = {}
|
|
}
|
|
|
|
variable "create_users" {
|
|
description = "Create one Kafka user per topic owner."
|
|
type = bool
|
|
default = true
|
|
}
|
|
|
|
variable "default_user_roles" {
|
|
description = "Kafka roles granted to generated owner users on their topics."
|
|
type = list(string)
|
|
default = ["ACCESS_ROLE_PRODUCER", "ACCESS_ROLE_CONSUMER"]
|
|
}
|
|
|
|
variable "user_password_length" {
|
|
description = "Generated Kafka user password length."
|
|
type = number
|
|
default = 32
|
|
}
|