Files
kydah-modules/service/variables.tf
2024-01-15 09:30:00 +01:00

49 lines
1.0 KiB
HCL

variable "component" {
type = string
}
variable "instance" {
type = string
}
variable "namespace" {
type = string
}
variable "labels" {
type = map(string)
}
variable "svc_type" {
type = string
default = "ClusterIP"
validation {
condition = contains(["ClusterIP", "ExternalName", "NodePort"], var.svc_type)
error_message = "Only ClusterIP or ExternalName is allowed"
}
}
variable "ports" {
type = list(number)
default = [80]
}
variable "targets" {
type = list(string)
default = ["http"]
}
variable "protocols" {
type = list(any)
default = ["TCP"]
validation {
condition = alltrue([for proto in var.protocols : contains(["TCP", "UDP"], proto)])
error_message = "Only TCP or UDP is allowed"
}
}
variable "target_host" {
type = string
default = ""
}
variable "node_ports" {
type = list(number)
default = [30080]
validation {
condition = alltrue([for port in var.node_ports : port >= 30000 && port <= 32767])
error_message = "The range of valid ports is 30000-32767"
}
}