Improve modules
This commit is contained in:
@@ -1,24 +1,48 @@
|
||||
variable "component" {
|
||||
type = string
|
||||
type = string
|
||||
}
|
||||
variable "instance" {
|
||||
type = string
|
||||
type = string
|
||||
}
|
||||
variable "namespace" {
|
||||
type = string
|
||||
type = string
|
||||
}
|
||||
variable "labels" {
|
||||
type = map(string)
|
||||
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
|
||||
default = [80]
|
||||
type = list(number)
|
||||
default = [80]
|
||||
}
|
||||
variable "targets" {
|
||||
type = list
|
||||
default = ["http"]
|
||||
type = list(string)
|
||||
default = ["http"]
|
||||
}
|
||||
variable "protocols" {
|
||||
type = list
|
||||
default = ["TCP"]
|
||||
}
|
||||
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"
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user