-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathvariable.tf
More file actions
55 lines (46 loc) · 1.37 KB
/
variable.tf
File metadata and controls
55 lines (46 loc) · 1.37 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
variable "image" {
type = map(any)
description = "image for container"
default = {
nodered = {
dev = "nodered/node-red:latest"
prod = "nodered/node-red:latest-minimal"
}
influxdb = {
dev = "quay.io/influxdb/influxdb:v2.0.2"
prod = "quay.io/influxdb/influxdb:v2.0.2"
}
grafana = {
dev = "grafana/grafana-enterprise"
prod = "grafana/grafana-enterprise"
}
}
}
variable "ext_port" {
type = map(any)
# validation {
# condition = max(var.ext_port["dev"]...) <= 65535 && min(var.ext_port["dev"]...) >= 1980
# error_message = "The external port must be in the valid port range 1980 - 65535."
# }
# validation {
# condition = max(var.ext_port["prod"]...) <= 1980 && min(var.ext_port["prod"]...) >= 1880
# error_message = "The external port must be in the valid port range 1880- 1980."
# }
}
variable "int_port" {
type = number
default = 1880
# validation {
# condition = var.int_port == 1880
# error_message = "The internal port must be 1880."
# }
}
# errored - function connot applied in variable so replacing this with locals
# variable container_count {
# type = number
# default= length(var.ext_port)
# }
# locals {
# # container_count = length(lookup(var.ext_port,terraform.workspace))
# container_count = length(var.ext_port[terraform.workspace])
# }