-
Notifications
You must be signed in to change notification settings - Fork 0
/
variables.tf
253 lines (244 loc) · 6.17 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
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
# GCP params
variable "google_account_file" {
type = string
description = "Path to Google account file"
}
variable "project_id" {
type = string
description = "GCP Project ID"
}
variable "region" {
type = string
default = "us-central1"
description = "GCP region where to deploy the cluster"
}
variable "zone" {
type = string
description = "GCP zone"
}
variable "allowed_ip_list" {
type = list(string)
default = ["0.0.0.0/0"]
description = "IP address list for SSH connection to the VMs"
}
# GCP Network
variable "subnet_prefix" {
default = "10.128.0.0/28"
description = "The address prefix to use for the subnet"
}
variable "parent_dns_zone_name" {
type = string
default = "GCP"
description = "GCP parent project DNS zone name"
}
variable "parent_dns_project_id" {
type = string
default = ""
description = "GCP parent project ID"
}
variable "google_kms_key_ring" {
type = string
default = ""
description = "GCP KMS key ring"
}
variable "google_kms_crypto_key" {
type = string
default = ""
description = "GCP KMS crypto key"
}
# GCP Compute
variable "control_plane_instance_count" {
type = string
default = "3"
description = "Control plane instances number"
}
variable "control_plane_machine_type" {
type = string
default = "e2-standard-2"
description = "Control plane instance machine type"
}
variable "worker_plane_machine_type" {
type = string
default = "n2-standard-2"
description = "Worker plane instance machine type"
}
variable "preemptible_instance_type" {
type = bool
default = false
description = "Sets preemptible instance type"
}
variable "workers_instance_templates" {
type = map(any)
default = {
worker-template = {
name_prefix = "worker-template-default-"
machine_type = "n1-standard-2"
image_family_name = "centos-image"
preemptible = false
}
}
description = "Worker instance template map"
}
variable "workers_groups" {
type = map(any)
default = {
workers-group = {
base_instance_name = "worker"
zone = "us-central1-a"
target_size = 3
instance_template = "worker-template"
}
}
description = "Worker instance group map"
}
variable "enable_nomad" {
type = bool
default = true
description = "Enables and setup Nomad cluster"
}
variable "enable_monitoring" {
type = bool
default = true
description = "Enables and setup monitoring node"
}
variable "base64" {
type = bool
default = false
description = "Cloud init decoding"
}
variable "gzip" {
type = bool
default = false
description = "Cloud init compressing"
}
variable "image" {
type = string
description = "Fully qualified image name"
}
# Hashicorp params
variable "dc_name" {
type = string
default = "gcp-dc"
validation {
condition = can(regex("^([a-z0-9]+(-[a-z0-9]+)*)+$", var.dc_name))
error_message = "Invalid dc_name. Must contain letters, numbers and hyphen."
}
description = "Hashicorp cluster name"
}
variable "prefix" {
default = ""
description = "The prefix of the objects' names"
}
variable "external_domain" {
type = string
default = ""
description = "Domain used for endpoints and certs"
}
variable "ca_certs" {
type = map(object({
filename = string
pemurl = string
}))
default = {
stg-int-r3 = {
filename = "letsencrypt-stg-int-r3.pem"
pemurl = "https://letsencrypt.org/certs/staging/letsencrypt-stg-int-r3.pem"
},
stg-root-x1 = {
filename = "letsencrypt-stg-root-x1.pem"
pemurl = "https://letsencrypt.org/certs/staging/letsencrypt-stg-root-x1.pem"
}
}
description = "Fake certificates from staging Let's Encrypt"
}
variable "control_plane_sa_name" {
type = string
default = "control-plane"
description = "Control plane service account name, it will be used by Vault Auth method"
}
variable "worker_plane_sa_name" {
type = string
default = "worker-plane"
description = "Worker plane service account name, it will be used by Vault Auth method"
}
variable "csi_volumes" {
type = map(map(string))
default = {}
description = <<EOF
Example:
{
"jenkins" : {
"type" : "pd-ssd"
"size" : "30"
"replica_zones" : ["us-central1-a", "us-central1-b"]
"tags" : { "application": "jenkins_master" }
}
}
EOF
}
variable "volume_root_size" {
type = number
default = 20
description = "Volume size of control plan root disk"
}
variable "volume_root_type" {
type = string
default = "pd-standard"
description = "Volume type of root disks"
}
variable "volume_data_size" {
type = number
default = 20
description = "Volume size of control plan data disk"
}
variable "volume_data_type" {
type = string
default = "pd-balanced"
description = "Volume type of data disks"
}
# Common
variable "ssh_user" {
type = string
default = "centos"
description = "SSH user"
}
variable "ssh_timeout" {
type = string
default = "240s"
description = "SSH timeout"
}
variable "admins" {
type = list(string)
default = []
description = "List of admins to add to the project"
}
variable "use_le_staging" {
type = bool
default = false
description = "Use staging Let's Encrypt endpoint"
}
variable "le_staging_endpoint" {
type = string
default = "https://acme-staging-v02.api.letsencrypt.org/directory"
description = "LE's endpoint when use_le_staging==true"
}
variable "le_production_endpoint" {
type = string
default = "https://acme-v02.api.letsencrypt.org/directory"
description = "LE's endpoint when use_le_staging==false"
}
variable "vault_license_file" {
type = string
default = null
description = "Path to Vault Enterprise license"
}
variable "consul_license_file" {
type = string
default = null
description = "Path to Consul Enterprise license"
}
variable "nomad_license_file" {
type = string
default = null
description = "Path to Nomad Enterprise license"
}