-
Notifications
You must be signed in to change notification settings - Fork 4
/
Copy pathvariables.tf
48 lines (42 loc) · 1.15 KB
/
variables.tf
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
variable "region" {
type = string
description = "AWS Region"
default = "eu-west-1"
}
variable "kubeconfig_output_location" {
type = string
description = "KubeConfig file Location"
}
variable "minikube_instance_name" {
type = string
description = "Minikube EC2 Instance name"
default = "minikube-on-ec2"
}
variable "instance_type" {
type = string
description = "EC2 instance type"
default = "t3.xlarge"
}
variable "exposed_ports" {
type = list(object({
port = number
protocol = string
}))
description = "Ports to expose from Minikube EC2 instance"
default = [{
port = 80
protocol = "tcp"
}]
validation {
condition = var.exposed_ports == null ? true : (alltrue([
for o in var.exposed_ports : contains(["tcp", "udp", "icmp", "all", "-1"], o.protocol)
]))
error_message = "The exposed_ports[].prococol should one of: tcp, udp, icmp, all, -1."
}
validation {
condition = var.exposed_ports == null ? true : (alltrue([
for o in var.exposed_ports : can(tonumber(o.port))
]))
error_message = "var.exposed_ports[].port should be a number"
}
}