generated from sudo-terraform-aws-modules/sudo-terraform-module-template
-
Notifications
You must be signed in to change notification settings - Fork 2
/
Copy pathvariables.tf
581 lines (485 loc) · 17.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
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
variable "create_vpc" {
description = "Controls if VPC should be created (it affects almost all resources)"
type = bool
default = true
}
variable "name" {
description = "Name to be used on all the resources as identifier"
type = string
default = "sudo-vpc"
}
variable "cidr" {
description = "(Optional) The IPv4 CIDR block for the VPC. CIDR can be explicitly set or it can be derived from IPAM using `ipv4_netmask_length` & `ipv4_ipam_pool_id`"
type = string
default = "0.0.0.0/0"
}
variable "use_ipam_pool" {
description = "Determines whether IPAM pool is used for CIDR allocation"
type = bool
default = false
}
variable "ipv4_ipam_pool_id" {
description = "(Optional) The ID of an IPv4 IPAM pool you want to use for allocating this VPC's CIDR."
type = string
default = null
}
variable "ipv4_netmask_length" {
description = "(Optional) The netmask length of the IPv4 CIDR you want to allocate to this VPC. Requires specifying a ipv4_ipam_pool_id."
type = number
default = null
}
variable "enable_ipv6" {
description = "Requests an Amazon-provided IPv6 CIDR block with a /56 prefix length for the VPC. You cannot specify the range of IP addresses, or the size of the CIDR block."
type = bool
default = false
}
variable "ipv6_cidr" {
description = "(Optional) IPv6 CIDR block to request from an IPAM Pool. Can be set explicitly or derived from IPAM using `ipv6_netmask_length`."
type = string
default = null
}
variable "ipv6_ipam_pool_id" {
description = "(Optional) IPAM Pool ID for a IPv6 pool. Conflicts with `assign_generated_ipv6_cidr_block`."
type = string
default = null
}
variable "ipv6_netmask_length" {
description = "(Optional) Netmask length to request from IPAM Pool. Conflicts with `ipv6_cidr_block`. This can be omitted if IPAM pool as a `allocation_default_netmask_length` set. Valid values: `56`."
type = number
default = null
}
variable "instance_tenancy" {
description = "A tenancy option for instances launched into the VPC"
type = string
default = "default"
}
# SUDO: Should be set to true, since most services require this
variable "enable_dns_hostnames" {
description = "Should be true to enable DNS hostnames in the VPC"
type = bool
default = true
}
variable "enable_dns_support" {
description = "Should be true to enable DNS support in the VPC"
type = bool
default = true
}
variable "tags" {
description = "A map of tags to add to all resources"
type = map(string)
default = {}
}
variable "vpc_tags" {
description = "Additional tags for the VPC"
type = map(string)
default = {}
}
variable "public_subnets" {
description = "A list of public subnets inside the VPC"
type = list(string)
default = []
}
variable "one_nat_gateway_per_az" {
description = "Should be true if you want only one NAT Gateway per availability zone. Requires `var.azs` to be set, and the number of `public_subnets` created to be greater than or equal to the number of availability zones specified in `var.azs`."
type = bool
default = false
}
variable "azs" {
description = "A list of availability zones names or ids in the region"
type = list(string)
default = []
}
variable "map_public_ip_on_launch" {
description = "Should be false if you do not want to auto-assign public IP on launch"
type = bool
default = true
}
variable "public_subnet_assign_ipv6_address_on_creation" {
description = "Assign IPv6 address on public subnet, must be disabled to change IPv6 CIDRs. This is the IPv6 equivalent of map_public_ip_on_launch"
type = bool
default = null
}
variable "assign_ipv6_address_on_creation" {
description = "Assign IPv6 address on subnet, must be disabled to change IPv6 CIDRs. This is the IPv6 equivalent of map_public_ip_on_launch"
type = bool
default = false
}
variable "public_subnet_ipv6_prefixes" {
description = "Assigns IPv6 public subnet id based on the Amazon provided /56 prefix base 10 integer (0-256). Must be of equal length to the corresponding IPv4 subnet list"
type = list(string)
default = []
}
variable "public_subnet_names" {
description = "Explicit values to use in the Name tag on public subnets. If empty, Name tags are generated."
type = list(string)
default = []
}
variable "public_subnet_suffix" {
description = "Suffix to append to public subnets name"
type = string
default = "public"
}
variable "public_subnet_tags" {
description = "Additional tags for the public subnets"
type = map(string)
default = {}
}
variable "private_subnets" {
description = "A list of private subnets inside the VPC"
type = list(string)
default = []
}
variable "private_subnet_assign_ipv6_address_on_creation" {
description = "Assign IPv6 address on private subnet, must be disabled to change IPv6 CIDRs. This is the IPv6 equivalent of map_public_ip_on_launch"
type = bool
default = null
}
variable "private_subnet_ipv6_prefixes" {
description = "Assigns IPv6 private subnet id based on the Amazon provided /56 prefix base 10 integer (0-256). Must be of equal length to the corresponding IPv4 subnet list"
type = list(string)
default = []
}
variable "private_subnet_names" {
description = "Explicit values to use in the Name tag on private subnets. If empty, Name tags are generated."
type = list(string)
default = []
}
variable "private_subnet_suffix" {
description = "Suffix to append to private subnets name"
type = string
default = "private"
}
variable "private_subnet_tags" {
description = "Additional tags for the private subnets"
type = map(string)
default = {}
}
variable "igw_tags" {
description = "Additional tags for the internet gateway"
type = map(string)
default = {}
}
variable "enable_nat_gateway" {
description = "Should be true if you want to provision NAT Gateways for each of your private networks"
type = bool
default = false
}
variable "nat_eip_tags" {
description = "Additional tags for the NAT EIP"
type = map(string)
default = {}
}
variable "reuse_nat_ips" {
description = "Should be true if you don't want EIPs to be created for your NAT Gateways and will instead pass them in via the 'external_nat_ip_ids' variable"
type = bool
default = false
}
variable "external_nat_ip_ids" {
description = "List of EIP IDs to be assigned to the NAT Gateways (used in combination with reuse_nat_ips)"
type = list(string)
default = []
}
variable "single_nat_gateway" {
description = "Should be true if you want to provision a single shared NAT Gateway across all of your private networks"
type = bool
default = true
}
variable "nat_gateway_tags" {
description = "Additional tags for the NAT gateways"
type = map(string)
default = {}
}
variable "nat_gateway_destination_cidr_block" {
description = "Used to pass a custom destination route for private NAT Gateway. If not specified, the default 0.0.0.0/0 is used as a destination route."
type = string
default = "0.0.0.0/0"
}
variable "public_route_table_tags" {
description = "Additional tags for the public route tables"
type = map(string)
default = {}
}
variable "create_igw" {
description = "Controls if an Internet Gateway is created for public subnets and the related routes that connect them."
type = bool
default = true
}
variable "private_route_table_tags" {
description = "Additional tags for the private route tables"
type = map(string)
default = {}
}
variable "secondary_cidr_blocks" {
description = "List of secondary CIDR blocks to associate with the VPC to extend the IP Address pool"
type = list(string)
default = []
}
# SUDO: Default is set to true
variable "manage_default_security_group" {
description = "Should be true to adopt and manage default security group"
type = bool
default = true
}
variable "default_security_group_name" {
description = "Name to be used on the default security group"
type = string
default = null
}
variable "default_security_group_ingress" {
description = "List of maps of ingress rules to set on the default security group"
type = list(map(string))
default = []
}
variable "default_security_group_egress" {
description = "List of maps of egress rules to set on the default security group"
type = list(map(string))
default = []
}
variable "default_security_group_tags" {
description = "Additional tags for the default security group"
type = map(string)
default = {}
}
variable "enable_flow_log" {
type = bool
description = "(optional) Enable Flow lgos. Default: true"
default = true
}
variable "create_flow_log_cloudwatch_log_group" {
type = bool
description = "(optional) Create Flow Log CloudWatch Log Group. Default: true"
default = true
}
variable "create_flow_log_cloudwatch_iam_role" {
type = bool
description = "(optional) Create Flow Log CloudWatch IAM Role. Default: true"
default = true
}
# variable "create_flow_log_cloudwatch_iam_role" {
# type = number
# description = "(optional) Flowlog max aggregation interval. Default: 60"
# default = 60
# }
variable "vpc_flow_log_tags" {
description = "(optional) Additional tags for the VPC Flow Logs"
type = map(string)
default = {}
}
variable "vpc_flow_log_permissions_boundary" {
description = "{90tional) The ARN of the Permissions Boundary for the VPC Flow Log IAM Role"
type = string
default = null
}
# TODO: Apply SUDO best practices
variable "flow_log_traffic_type" {
description = "The type of traffic to capture. Valid values: ACCEPT, REJECT, ALL. Default: REJECT"
type = string
default = "REJECT"
}
variable "flow_log_destination_type" {
description = "Type of flow log destination. Can be s3 or cloud-watch-logs. Default: cloud-watch-logs"
type = string
default = "cloud-watch-logs"
}
variable "flow_log_log_format" {
description = "The fields to include in the flow log record, in the order in which they should appear."
type = string
default = null
}
variable "flow_log_destination_arn" {
description = "(optional) The ARN of the CloudWatch log group or S3 bucket where VPC Flow Logs will be pushed. If this ARN is a S3 bucket the appropriate permissions need to be set on that bucket's policy. When create_flow_log_cloudwatch_log_group is set to false this argument must be provided."
type = string
default = ""
}
variable "flow_log_cloudwatch_iam_role_arn" {
description = "(optional) The ARN for the IAM role that's used to post flow logs to a CloudWatch Logs log group. When flow_log_destination_arn is set to ARN of Cloudwatch Logs, this argument needs to be provided."
type = string
default = ""
}
variable "flow_log_cloudwatch_log_group_name_prefix" {
description = "(optional) Specifies the name prefix of CloudWatch Log Group for VPC flow logs."
type = string
default = "/aws/vpc-flow-log/"
}
variable "flow_log_cloudwatch_log_group_name_suffix" {
description = "(optional) Specifies the name suffix of CloudWatch Log Group for VPC flow logs."
type = string
default = ""
}
variable "flow_log_cloudwatch_log_group_retention_in_days" {
description = "(optional) Specifies the number of days you want to retain log events in the specified log group for VPC flow logs."
type = number
default = null
}
variable "flow_log_cloudwatch_log_group_kms_key_id" {
description = "(optional) The ARN of the KMS Key to use when encrypting log data for VPC flow logs."
type = string
default = null
}
variable "flow_log_max_aggregation_interval" {
description = "(optional) The maximum interval of time during which a flow of packets is captured and aggregated into a flow log record. Valid Values: `60` seconds or `600` seconds."
type = number
default = 600
}
variable "enable_vpn_gateway" {
description = "(optional) Set it to true if you want to create new vpn gateway. Default: false"
type = bool
default = false
}
variable "vpn_gateway_id" {
description = "(optional) Provide the ID of existing VPN gateway to attach to VPC"
type = string
default = ""
}
variable "amazon_side_asn" {
description = "(optional) Provide ASN for the gateway. Default: 64512"
type = string
default = "64512"
}
variable "vpn_gateway_tags" {
description = "(optional) Additional tags for the VPN gateway"
type = map(string)
default = {}
}
variable "customer_gateways" {
description = "(optional) Maps of Customer Gateways"
type = map(map(any))
default = {}
}
variable "customer_gateway_tags" {
description = "(optional) Customer Gateway additional tags"
type = map(string)
default = {}
}
variable "vpn_gateway_az" {
description = "VPN Gateway Availability Zone"
type = string
default = null
}
variable "propagate_intra_route_tables_vgw" {
description = "(optional) Set to true to enable route table propogation. Default: false"
type = bool
default = false
}
variable "propagate_private_route_tables_vgw" {
description = "(optional) Set to true to enable route table propogation. Default: false"
type = bool
default = false
}
variable "propagate_public_route_tables_vgw" {
description = "(optional) Set to true to enable route table propogation. Default: false"
type = bool
default = false
}
variable "manage_default_vpc" {
description = "(optional) Manage Default VPC. Default: false"
type = bool
default = false
}
variable "default_vpc_name" {
description = "(optional) Default VPC Name. Default: null"
type = string
default = null
}
variable "default_vpc_enable_dns_support" {
description = "(optional) Set to true to enable Default VPC DNS Support. Default: true"
type = bool
default = true
}
variable "default_vpc_enable_dns_hostnames" {
description = "(optional) Set to true to enable Default VPC DNS Hostname. Default: true"
type = bool
default = false
}
# tflint-ignore: terraform_unused_declarations
variable "default_vpc_enable_classiclink" {
description = "Backward compatibility only, not used."
type = bool
default = false
}
variable "default_vpc_tags" {
description = "(optional) Default VPC tags. Default: {}"
type = map(string)
default = {}
}
variable "manage_default_network_acl" {
description = "(optional) Default network ACL management. Default: false"
type = bool
default = false
}
## Add Database compatibility variables to keep it compatible with the existing module.
variable "database_subnets" {
description = "A list of database subnets inside the VPC"
type = list(string)
default = []
}
variable "database_subnet_assign_ipv6_address_on_creation" {
description = "Assign IPv6 address on database subnet, must be disabled to change IPv6 CIDRs. This is the IPv6 equivalent of map_public_ip_on_launch"
type = bool
default = null
}
variable "database_subnet_ipv6_prefixes" {
description = "Assigns IPv6 database subnet id based on the Amazon provided /56 prefix base 10 integer (0-256). Must be of equal length to the corresponding IPv4 subnet list"
type = list(string)
default = []
}
variable "database_subnet_names" {
description = "Explicit values to use in the Name tag on database subnets. If empty, Name tags are generated."
type = list(string)
default = []
}
variable "database_subnet_suffix" {
description = "Suffix to append to database subnets name"
type = string
default = "database"
}
variable "database_subnet_tags" {
description = "Additional tags for the database subnets"
type = map(string)
default = {}
}
variable "create_database_subnet_group" {
description = "Controls if database subnet group should be created (n.b. database_subnets must also be set)"
type = bool
default = true
}
variable "database_subnet_group_tags" {
description = "Additional tags for the database subnet group"
type = map(string)
default = {}
}
variable "database_subnet_group_name" {
description = "Name to be used on the database subnet group"
type = string
default = null
}
variable "database_route_table_tags" {
description = "Additional tags for the database route tables"
type = map(string)
default = {}
}
variable "create_database_subnet_route_table" {
description = "Controls if separate route table for database should be created"
type = bool
default = false
}
variable "create_database_internet_gateway_route" {
description = "Controls if an internet gateway route for public database access should be created"
type = bool
default = false
}
variable "create_database_nat_gateway_route" {
description = "Controls if a nat gateway route should be created to give internet access to the database subnets"
type = bool
default = false
}
variable "create_egress_only_igw" {
description = "Controls if an Egress Only Internet Gateway is created and its related routes."
type = bool
default = true
}
variable "database_dedicated_network_acl" {
description = "Whether to use dedicated network ACL (not default) and custom rules for database subnets"
type = bool
default = false
}