-
Notifications
You must be signed in to change notification settings - Fork 43
/
variables.tf
522 lines (390 loc) · 10.5 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
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
# Network settings
variable "vpc_id" {
description = "VPC ID for the AWS account and region specified"
type = string
}
variable "subnet_tag" {
description = "Tag used on subnets to define Tier"
type = string
default = "Tier"
}
variable "private_subnets" {
description = "Subnet tag on private subnets"
type = string
default = "private"
}
variable "public_subnets" {
description = "Subnet tag on public subnets for external load balancers"
type = string
default = "public"
}
variable "additional_security_groups" {
description = "IDs of the additional security groups attached to Kong EC2 instance"
type = list(string)
default = []
}
# Access control
variable "bastion_cidr_blocks" {
description = "Bastion hosts allowed access to PostgreSQL and Kong Admin"
type = list(string)
default = [
"127.0.0.1/32",
]
}
variable "external_cidr_blocks" {
description = "External ingress access to Kong Proxy via the load balancer"
type = list(string)
default = [
"0.0.0.0/0",
]
}
variable "internal_http_cidr_blocks" {
description = "Internal ingress access to Kong Proxy via the load balancer (HTTP)"
type = list(string)
default = [
"0.0.0.0/0",
]
}
variable "internal_https_cidr_blocks" {
description = "Internal ingress access to Kong Proxy via the load balancer (HTTPS)"
type = list(string)
default = [
"0.0.0.0/0",
]
}
variable "admin_cidr_blocks" {
description = "Access to Kong Admin API (Enterprise Edition only)"
type = list(string)
default = [
"0.0.0.0/0",
]
}
variable "manager_cidr_blocks" {
description = "Access to Kong Manager (Enterprise Edition only)"
type = list(string)
default = [
"0.0.0.0/0",
]
}
variable "portal_cidr_blocks" {
description = "Access to Portal (Enterprise Edition only)"
type = list(string)
default = [
"0.0.0.0/0",
]
}
variable "manager_host" {
description = "Hostname to access Kong Manager (Enterprise Edition only)"
type = string
default = "default"
}
variable "portal_host" {
description = "Hostname to access Portal (Enterprise Edition only)"
type = string
default = "default"
}
# Required tags
variable "description" {
description = "Resource description tag"
type = string
default = "Kong API Gateway"
}
variable "environment" {
description = "Resource environment tag (i.e. dev, stage, prod)"
type = string
}
variable "service" {
description = "Resource service tag"
type = string
default = "kong"
}
# Additional tags
variable "tags" {
description = "Tags to apply to resources"
type = map(string)
default = {}
}
# Enterprise Edition
variable "enable_ee" {
description = "Boolean to enable Kong Enterprise Edition settings"
type = string
default = false
}
variable "ee_license" {
description = "Enterprise Edition license key (JSON format)"
type = string
default = "placeholder"
}
# EC2 settings
# https://wiki.ubuntu.com/Minimal
variable "ec2_ami" {
description = "Map of Ubuntu Minimal AMIs by region"
type = map(string)
default = {
us-east-1 = "ami-097f2dec72be3d174"
us-east-2 = "ami-0ba142a7063a73767"
us-west-1 = "ami-07b69f5dcdbb4abaf"
us-west-2 = "ami-028b81a9f357b2b96"
eu-central-1 = "ami-0cbcfdbe2416ea8df"
eu-west-1 = "ami-0eb00845cbc30b475"
}
}
variable "ec2_instance_type" {
description = "EC2 instance type"
type = string
default = "t2.micro"
}
variable "ec2_root_volume_size" {
description = "Size of the root volume (in Gigabytes)"
type = string
default = 8
}
variable "ec2_root_volume_type" {
description = "Type of the root volume (standard, gp2, or io)"
type = string
default = "gp2"
}
variable "ec2_key_name" {
description = "AWS SSH Key"
type = string
default = ""
}
variable "asg_max_size" {
description = "The maximum size of the auto scale group"
type = string
default = 3
}
variable "asg_min_size" {
description = "The minimum size of the auto scale group"
type = string
default = 1
}
variable "asg_desired_capacity" {
description = "The number of instances that should be running in the group"
type = string
default = 2
}
variable "asg_health_check_grace_period" {
description = "Time in seconds after instance comes into service before checking health"
type = string
# Terraform default is 300
default = 300
}
# Kong packages
variable "ee_pkg" {
description = "Filename of the Enterprise Edition package"
type = string
default = "kong-enterprise-edition_2.8.1.4_all.deb"
}
variable "ce_pkg" {
description = "Filename of the Community Edition package"
type = string
default = "kong_2.8.1_amd64.deb"
}
# Load Balancer settings
variable "enable_external_lb" {
description = "Boolean to enable/create the external load balancer, exposing Kong to the Internet"
type = string
default = true
}
variable "enable_internal_lb" {
description = "Boolean to enable/create the internal load balancer for the forward proxy"
type = string
default = true
}
variable "deregistration_delay" {
description = "Seconds to wait before changing the state of a deregistering target from draining to unused"
type = string
# Terraform default is 300
default = 300
}
variable "enable_deletion_protection" {
description = "Boolean to enable delete protection on the ALB"
type = string
# Terraform default is false
default = true
}
variable "health_check_healthy_threshold" {
description = "Number of consecutives checks before a unhealthy target is considered healthy"
type = string
# Terraform default is 5
default = 5
}
variable "health_check_interval" {
description = "Seconds between health checks"
type = string
# Terraform default is 30
default = 5
}
variable "health_check_matcher" {
description = "HTTP Code(s) that result in a successful response from a target (comma delimited)"
type = string
default = 200
}
variable "health_check_timeout" {
description = "Seconds waited before a health check fails"
type = string
# Terraform default is 5
default = 3
}
variable "health_check_unhealthy_threshold" {
description = "Number of consecutive checks before considering a target unhealthy"
type = string
# Terraform default is 2
default = 2
}
variable "idle_timeout" {
description = "Seconds a connection can idle before being disconnected"
type = string
# Terraform default is 60
default = 60
}
variable "ssl_cert_external" {
description = "SSL certificate domain name for the external Kong Proxy HTTPS listener"
type = string
default = null
}
variable "ssl_cert_internal" {
description = "SSL certificate domain name for the internal Kong Proxy HTTPS listener"
type = string
default = null
}
variable "ssl_cert_admin" {
description = "SSL certificate domain name for the Kong Admin API HTTPS listener"
type = string
default = null
}
variable "ssl_cert_manager" {
description = "SSL certificate domain name for the Kong Manager HTTPS listener"
type = string
default = null
}
variable "ssl_cert_portal" {
description = "SSL certificate domain name for the Dev Portal listener"
type = string
default = null
}
variable "ssl_policy" {
description = "SSL Policy for HTTPS Listeners"
type = string
default = "ELBSecurityPolicy-TLS-1-2-2017-01"
}
# Cloudwatch alarms
variable "cloudwatch_actions" {
description = "List of cloudwatch actions for Alert/Ok"
type = list(string)
default = []
}
variable "http_4xx_count" {
description = "HTTP Code 4xx count threshhold"
type = string
default = 50
}
variable "http_5xx_count" {
description = "HTTP Code 5xx count threshhold"
type = string
default = 50
}
# Datastore settings
variable "enable_aurora" {
description = "Boolean to enable Aurora"
type = string
default = "false"
}
variable "db_engine_version" {
description = "Database engine version"
type = string
default = "11.14"
}
variable "db_engine_mode" {
description = "Engine mode for Aurora"
type = string
default = "provisioned"
}
variable "db_family" {
description = "Database parameter group family"
type = string
default = "postgres11"
}
variable "db_instance_class" {
description = "Database instance class"
type = string
default = "db.t2.micro"
}
variable "db_instance_count" {
description = "Number of database instances (0 to leverage an existing db)"
type = string
default = 1
}
variable "db_storage_size" {
description = "Size of the database storage in Gigabytes"
type = string
# 100 is the recommended AWS minimum
default = 100
}
variable "db_storage_type" {
description = "Type of the database storage"
type = string
default = "gp2"
}
variable "db_username" {
description = "Database master username"
type = string
default = "root"
}
variable "db_subnets" {
description = "Database instance subnet group name"
type = string
default = "db-subnets"
}
variable "db_multi_az" {
description = "Boolean to specify if RDS is multi-AZ"
type = string
default = false
}
variable "db_backup_retention_period" {
description = "The number of days to retain backups"
type = string
default = 7
}
# Redis settings (for rate_limiting only)
variable "enable_redis" {
description = "Boolean to enable redis AWS resource"
type = string
default = false
}
variable "redis_instance_type" {
description = "Redis node instance type"
type = string
default = "cache.t2.small"
}
variable "redis_engine_version" {
description = "Redis engine version"
type = string
default = "5.0.5"
}
variable "redis_family" {
description = "Redis parameter group family"
type = string
default = "redis5.0"
}
variable "redis_instance_count" {
description = "Number of redis nodes"
type = string
default = 2
}
variable "redis_subnets" {
description = "Redis cluster subnet group name"
type = string
default = "cache-subnets"
}
variable "deck_version" {
description = "Version of decK to install"
type = string
default = "1.14.0"
}
variable "db_final_snapshot_identifier" {
description = "The final snapshot name of the RDS/Aurora instance when it gets destroyed"
type = string
default = ""
}