-
Notifications
You must be signed in to change notification settings - Fork 1
/
variables.tf
485 lines (429 loc) · 10.4 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
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
#### Provider variables
variable "region1" {
description = "AWS region"
}
variable "region2" {
description = "AWS region"
}
variable "aws_creds" {
description = "Access key and Secret key for AWS [Access Keys, Secret Key]"
}
#### Important variables
variable "ssh_key_name1" {
description = "name of ssh key to be added to instance"
}
variable "ssh_key_name2" {
description = "name of ssh key to be added to instance"
}
variable "ssh_key_path1" {
description = "name of ssh key to be added to instance"
}
variable "ssh_key_path2" {
description = "name of ssh key to be added to instance"
}
variable "owner" {
description = "owner tag name"
}
#### VPC
variable "base_name1" {
description = "base name for resources (prefix name)"
default = "redisuser1-tf"
}
variable "base_name2" {
description = "base name for resources (prefix name)"
default = "redisuser2-tf"
}
variable "vpc_cidr1" {
description = "vpc-cidr1"
default = "10.0.0.0/16"
}
variable "vpc_cidr2" {
description = "vpc-cidr2"
default = "10.1.0.0/16"
}
variable "subnet_cidr_blocks1" {
type = list(any)
description = "subnet_cidr_block1"
default = ["10.0.1.0/24","10.0.2.0/24","10.0.3.0/24"]
}
variable "subnet_cidr_blocks2" {
type = list(any)
description = "subnet_cidr_block2"
default = ["10.1.1.0/24","10.1.2.0/24","10.1.3.0/24"]
}
variable "subnet_azs1" {
type = list(any)
description = "subnet availability zone"
default = [""]
}
variable "subnet_azs2" {
type = list(any)
description = "subnet availability zone"
default = [""]
}
#### DNS
variable "dns_hosted_zone_id" {
description = "DNS hosted zone Id"
}
#### Test Instance Variables
variable "test-node-count" {
description = "number of data nodes"
default = 1
}
variable "node-prefix-tester" {
description = "node prefix"
default = "tester"
}
variable "test_instance_type" {
description = "instance type to use. Default: t3.micro"
default = "t3.micro"
}
#### Redis Enterprise Cluster Variables
variable "re_download_url" {
description = "re download url"
default = ""
}
variable "flash_enabled" {
description = "Redis on Flash cluster"
default = false
}
variable "rack_awareness" {
description = "Rack zone aware cluster"
default = false
}
variable "data-node-count" {
description = "number of data nodes"
default = 3
}
variable "ena-support" {
description = "choose AMIs that have ENA support enabled"
default = true
}
variable "node-prefix-re" {
description = "node prefix"
default = "re"
}
variable "re_instance_type" {
description = "re instance type"
default = "t2.xlarge"
}
variable "node-root-size" {
description = "The size of the root volume"
default = "50"
}
#### EBS volume for persistent and ephemeral storage
variable "create_ebs_volumes_re" {
description = "Whether to create EBS volume or not"
type = bool
default = true
}
variable "create_ebs_volumes_tester" {
description = "Whether to create EBS volume or not"
type = bool
default = false
}
variable "re-volume-size" {
description = "The size of the ephemeral and persistent volumes to attach"
default = "150"
}
#### Security
variable "open-nets" {
type = list(any)
description = "CIDRs that will have access to everything"
default = []
}
variable "allow-public-ssh" {
description = "Allow SSH to be open to the public - enabled by default"
default = "1"
}
variable "internal-rules" {
description = "Security rules to allow for connectivity within the VPC"
type = list(any)
default = [
{
type = "ingress"
from_port = "22"
to_port = "22"
protocol = "tcp"
comment = "SSH from VPC"
},
{
type = "ingress"
from_port = "1968"
to_port = "1968"
protocol = "tcp"
comment = "Proxy traffic (Internal use)"
},
{
type = "ingress"
from_port = "3333"
to_port = "3341"
protocol = "tcp"
comment = "Cluster traffic (Internal use)"
},
{
type = "ingress"
from_port = "3343"
to_port = "3344"
protocol = "tcp"
comment = "Cluster traffic (Internal use)"
},
{
type = "ingress"
from_port = "36379"
to_port = "36380"
protocol = "tcp"
comment = "Cluster traffic (Internal use)"
},
{
type = "ingress"
from_port = "8001"
to_port = "8001"
protocol = "tcp"
comment = "Traffic from application to RS Discovery Service"
},
{
type = "ingress"
from_port = "8002"
to_port = "8002"
protocol = "tcp"
comment = "System health monitoring"
},
{
type = "ingress"
from_port = "8004"
to_port = "8004"
protocol = "tcp"
comment = "System health monitoring"
},
{
type = "ingress"
from_port = "8006"
to_port = "8006"
protocol = "tcp"
comment = "System health monitoring"
},
{
type = "ingress"
from_port = "8443"
to_port = "8443"
protocol = "tcp"
comment = "Secure (HTTPS) access to the management web UI"
},
{
type = "ingress"
from_port = "8444"
to_port = "8444"
protocol = "tcp"
comment = "nginx <-> cnm_http/cm traffic (Internal use)"
},
{
type = "ingress"
from_port = "9080"
to_port = "9080"
protocol = "tcp"
comment = "nginx <-> cnm_http/cm traffic (Internal use)"
},
{
type = "ingress"
from_port = "9081"
to_port = "9081"
protocol = "tcp"
comment = "For CRDB management (Internal use)"
},
{
type = "ingress"
from_port = "8070"
to_port = "8071"
protocol = "tcp"
comment = "Prometheus metrics exporter"
},
{
type = "ingress"
from_port = "9443"
to_port = "9443"
protocol = "tcp"
comment = "REST API traffic, including cluster management and node bootstrap"
},
{
type = "ingress"
from_port = "10000"
to_port = "19999"
protocol = "tcp"
comment = "Database traffic - if manually creating db ports pare down"
},
{
type = "ingress"
from_port = "20000"
to_port = "29999"
protocol = "tcp"
comment = "Database shards traffic - if manually creating db ports pare down"
},
{
type = "ingress"
from_port = "53"
to_port = "53"
protocol = "udp"
comment = "DNS Traffic"
},
{
type = "ingress"
from_port = "5353"
to_port = "5353"
protocol = "udp"
comment = "DNS Traffic"
},
{
type = "ingress"
from_port = "-1"
to_port = "-1"
protocol = "icmp"
comment = "Ping for connectivity checks between nodes"
},
{
type = "egress"
from_port = "-1"
to_port = "-1"
protocol = "icmp"
comment = "Ping for connectivity checks between nodes"
},
{
type = "egress"
from_port = "0"
to_port = "65535"
protocol = "tcp"
comment = "Let TCP out to the VPC"
},
{
type = "egress"
from_port = "0"
to_port = "65535"
protocol = "udp"
comment = "Let UDP out to the VPC"
},
# {
# type = "ingress"
# from_port = "8080"
# to_port = "8080"
# protocol = "tcp"
# comment = "Allow for host check between nodes"
# },
]
}
variable "external-rules" {
description = "Security rules to allow for connectivity external to the VPC"
type = list(any)
default = [
{
type = "ingress"
from_port = "53"
to_port = "53"
protocol = "udp"
cidr = ["0.0.0.0/0"]
},
{
type = "egress"
from_port = "0"
to_port = "65535"
protocol = "tcp"
cidr = ["0.0.0.0/0"]
},
{
type = "egress"
from_port = "0"
to_port = "65535"
protocol = "udp"
cidr = ["0.0.0.0/0"]
}
]
}
####### Create Cluster Variables
####### Node and DNS outputs used to Create Cluster
variable "dns_fqdn" {
description = "dns fqdn (cluster name)"
default = ""
}
variable "re-node-internal-ips" {
type = list
description = "re node internal ips"
default = []
}
variable "re-node-eip-ips" {
type = list
description = "re node eip ips"
default = []
}
variable "re-data-node-eip-public-dns" {
type = list
description = "re node eip public dns"
default = []
}
############# Create RE Cluster Variables
#### Cluster Inputs
#### RE Cluster Username
variable "re_cluster_username" {
description = "redis enterprise cluster username"
default = "[email protected]"
}
#### RE Cluster Password
variable "re_cluster_password" {
description = "redis enterprise cluster password"
default = "admin"
}
#### RE License File
variable "license_file" {
description = "paste RE license file between the variable quotes"
default = <<EOF
paste license file here
EOF
}
#### RE CRDB DB variable inputs
variable "crdb_db_name" {
description = "crdb db name"
default = "crdb-test1"
}
variable "crdb_port" {
description = "crdb port"
default = 12000
}
variable "crdb_db_password" {
description = "crdb password"
default = "password"
}
variable "crdb_memory_size" {
description = "memory size in bytes"
default = 5024000000
}
variable "crdb_replication" {
description = "replication yes no"
default = "True"
}
variable "crdb_aof_policy" {
description = "aof policy"
default = "appendfsync-every-sec"
}
variable "crdb_sharding" {
description = "sharding yes no"
default = "True"
}
variable "crdb_shards_count" {
description = "how many master shards"
default = 2
}
##### Memtier Benchmark
variable "memtier_data_load_cluster1" {
description = "data load cmd for cluster 1"
default = "."
}
variable "memtier_data_load_cluster2" {
description = "data load cmd for cluster 2"
default = "."
}
variable "memtier_benchmark_cluster1" {
description = "benchmark cmd for cluster 1"
default = "."
}
variable "memtier_benchmark_cluster2" {
description = "benchmark cmd for cluster 2"
default = "."
}