-
Notifications
You must be signed in to change notification settings - Fork 0
/
variables.tf
115 lines (96 loc) · 2.6 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
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
variable "aws_region" {
type = string
validation {
condition = can(regex("[a-z][a-z]-[a-z]+-[1-9]", var.aws_region))
error_message = "Invalid AWS Region name."
}
}
variable "aws_account_id" {
type = string
validation {
condition = length(var.aws_account_id) == 12 && can(regex("^\\d{12}$", var.aws_account_id))
error_message = "Invalid AWS account ID"
}
}
variable "aws_assume_role" { type = string }
variable "cluster_name" {
description = "cluster instance name"
type = string
}
variable "vpc_cidr" {
type = string
validation {
condition = can(cidrhost(var.vpc_cidr, 32))
error_message = "Invalid IPv4 CIDR"
}
}
variable "vpc_azs" {
description = "list of subnet AZs"
type = list(string)
validation {
condition = alltrue([
for v in var.vpc_azs : can(regex("[a-z][a-z]-[a-z]+-[1-9][a-c]", v))
])
error_message = "Invalid VPC AZ name"
}
validation {
condition = length(var.vpc_azs) == 3
error_message = "length of list(string) not equal to 3 "
}
}
variable "vpc_private_subnets" {
description = "private node group subnet"
type = list(string)
validation {
condition = alltrue([
for v in var.vpc_private_subnets : can(cidrhost(v, 32))
])
error_message = "Invalid IPv4 CIDR"
}
validation {
condition = length(var.vpc_private_subnets) == 3
error_message = "length of list(string) not equal to 3 "
}
}
variable "vpc_intra_subnets" {
description = "intra subnet"
type = list(string)
validation {
condition = alltrue([
for v in var.vpc_intra_subnets : can(cidrhost(v, 32))
])
error_message = "Invalid IPv4 CIDR"
}
validation {
condition = length(var.vpc_intra_subnets) == 3
error_message = "length of list(string) not equal to 3 "
}
}
variable "vpc_public_subnets" {
description = "public ingress load balancer subnet"
type = list(string)
validation {
condition = alltrue([
for v in var.vpc_public_subnets : can(cidrhost(v, 32))
])
error_message = "Invalid IPv4 CIDR"
}
validation {
condition = length(var.vpc_public_subnets) == 3
error_message = "length of list(string) not equal to 3 "
}
}
variable "vpc_database_subnets" {
description = "private database subnet"
type = list(string)
validation {
condition = alltrue([
for v in var.vpc_database_subnets : can(cidrhost(v, 32))
])
error_message = "Invalid IPv4 CIDR"
}
validation {
condition = length(var.vpc_database_subnets) == 3
error_message = "length of list(string) not equal to 3 "
}
}