variable "component" { type = string } variable "instance" { type = string } variable "namespace" { type = string } variable "labels" { type = map(string) } variable "annotations" { type = map(string) default = {} } variable "svc_type" { type = string default = "ClusterIP" validation { condition = contains(["ClusterIP", "ExternalName", "NodePort", "LoadBalancer"], var.svc_type) error_message = "Only ClusterIP, ExternalName, NodePort or LoadBalancer 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" } } variable "lb_ports" { type = list(number) default = [8080] } variable "lb_policy" { type = string default = "Cluster" validation { condition = contains(["Cluster", "Local"], var.lb_policy) error_message = "Only Cluster or Local is allowed" } }