-
Notifications
You must be signed in to change notification settings - Fork 15
/
variables.tf
386 lines (330 loc) · 11.3 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
#Module : LABEL
#Description : Terraform label module variables.
variable "name" {
type = string
default = ""
description = "Name (e.g. `prod-subnet` or `subnet`)."
}
variable "repository" {
type = string
default = "https://github.com/clouddrove/terraform-aws-subnet"
description = "Terraform current module repo"
validation {
# regex(...) fails if it cannot find a match
condition = can(regex("^https://", var.repository))
error_message = "The module-repo value must be a valid Git repo link."
}
}
variable "environment" {
type = string
default = ""
description = "Environment (e.g. `prod`, `dev`, `staging`)."
}
variable "label_order" {
type = list(any)
default = ["name", "environment"]
description = "Label order, e.g. `name`,`Environment`."
}
variable "attributes" {
type = list(any)
default = []
description = "Additional attributes (e.g. `1`)."
}
variable "delimiter" {
type = string
default = "-"
description = "Delimiter to be used between `organization`, `environment`, `name` and `attributes`."
}
variable "extra_public_tags" {
type = map(any)
default = {}
description = "Additional public subnet tags."
}
variable "extra_private_tags" {
type = map(any)
default = {}
description = "Additional private subnet tags."
}
variable "managedby" {
type = string
default = "[email protected]"
description = "ManagedBy, eg 'CloudDrove'."
}
#Module : SUBNET
#Description : Terraform SUBNET module variables.
variable "availability_zones" {
type = list(string)
default = []
description = "List of Availability Zones (e.g. `['us-east-1a', 'us-east-1b', 'us-east-1c']`)."
}
variable "type" {
type = string
default = ""
description = "Type of subnets to create (`private` or `public`)."
}
variable "vpc_id" {
type = string
description = "VPC ID."
sensitive = true
}
variable "cidr_block" {
type = string
default = null
description = "Base CIDR block which is divided into subnet CIDR blocks (e.g. `10.0.0.0/16`)."
}
variable "ipv6_cidr_block" {
type = string
default = null
description = "Base CIDR block which is divided into subnet CIDR blocks (e.g. `10.0.0.0/16`)."
}
variable "public_subnet_ids" {
type = list(string)
default = []
description = "A list of public subnet ids."
sensitive = true
}
variable "igw_id" {
type = string
default = ""
description = "Internet Gateway ID that is used as a default route when creating public subnets (e.g. `igw-9c26a123`)."
sensitive = true
}
variable "enable" {
type = bool
default = true
description = "Set to false to prevent the module from creating any resources."
}
variable "enable_public_acl" {
type = bool
default = true
description = "Set to false to prevent the module from creating any resources."
}
variable "enable_private_acl" {
type = bool
default = true
description = "Set to false to prevent the module from creating any resources."
}
variable "nat_gateway_enabled" {
type = bool
default = false
description = "Flag to enable/disable NAT Gateways creation in public subnets."
}
variable "enable_flow_log" {
type = bool
default = false
description = "Enable subnet_flow_log logs."
}
variable "map_public_ip_on_launch" {
type = bool
default = false
description = "Specify true to indicate that instances launched into the public subnet should be assigned a public IP address."
}
#Module : FLOW LOG
#Description : Terraform flow log module variables.
variable "flow_log_destination_arn" {
type = string
default = null
description = "ARN of resource in which flow log will be sent."
sensitive = true
}
variable "flow_log_destination_type" {
type = string
default = "cloud-watch-logs"
description = "Type of flow log destination. Can be s3 or cloud-watch-logs"
}
variable "flow_log_traffic_type" {
type = string
default = "ALL"
description = "Type of traffic to capture. Valid values: ACCEPT,REJECT, ALL."
}
variable "flow_log_log_format" {
type = string
default = null
description = "The fields to include in the flow log record, in the order in which they should appear"
}
variable "flow_log_iam_role_arn" {
type = string
default = null
description = "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"
}
variable "flow_log_max_aggregation_interval" {
type = number
default = 600
description = "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"
}
variable "flow_log_file_format" {
type = string
default = null
description = "(Optional) The format for the flow log. Valid values: `plain-text`, `parquet`"
}
variable "flow_log_hive_compatible_partitions" {
type = bool
default = false
description = "(Optional) Indicates whether to use Hive-compatible prefixes for flow logs stored in Amazon S3"
}
variable "flow_log_per_hour_partition" {
type = bool
default = false
description = "(Optional) Indicates whether to partition the flow log per hour. This reduces the cost and response time for queries"
}
variable "public_ipv6_cidrs" {
type = list(any)
default = []
description = "Public Subnet CIDR blocks (e.g. `2a05:d018:832:ca02::/64`)."
}
variable "private_ipv6_cidrs" {
type = list(any)
default = []
description = "Private Subnet CIDR blocks (e.g. `2a05:d018:832:ca02::/64`)."
}
variable "ipv4_public_cidrs" {
type = list(any)
default = []
description = "Subnet CIDR blocks (e.g. `10.0.0.0/16`)."
}
variable "ipv4_private_cidrs" {
type = list(any)
default = []
description = "Subnet CIDR blocks (e.g. `10.0.0.0/16`)."
}
variable "single_nat_gateway" {
type = bool
default = false
description = "Enable for only single NAT Gateway in one Availability Zone"
}
variable "public_subnet_assign_ipv6_address_on_creation" {
type = bool
default = false
description = "Specify true to indicate that network interfaces created in the specified subnet should be assigned an IPv6 address."
}
variable "private_subnet_assign_ipv6_address_on_creation" {
type = bool
default = false
description = "Specify true to indicate that network interfaces created in the specified subnet should be assigned an IPv6 address."
}
variable "public_subnet_private_dns_hostname_type_on_launch" {
type = string
default = null
description = "The type of hostnames to assign to instances in the subnet at launch. For IPv6-only subnets, an instance DNS name must be based on the instance ID. For dual-stack and IPv4-only subnets, you can specify whether DNS names use the instance IPv4 address or the instance ID. Valid values: `ip-name`, `resource-name`"
}
variable "private_subnet_private_dns_hostname_type_on_launch" {
type = string
default = null
description = "The type of hostnames to assign to instances in the subnet at launch. For IPv6-only subnets, an instance DNS name must be based on the instance ID. For dual-stack and IPv4-only subnets, you can specify whether DNS names use the instance IPv4 address or the instance ID. Valid values: `ip-name`, `resource-name`"
}
variable "public_subnet_ipv6_native" {
type = bool
default = false
description = "Indicates whether to create an IPv6-only public subnet. Default: `false`"
}
variable "private_subnet_ipv6_native" {
type = bool
default = false
description = "Indicates whether to create an IPv6-only private subnet. Default: `false`"
}
variable "enable_ipv6" {
type = bool
default = false
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"
}
variable "public_subnet_enable_dns64" {
type = bool
default = false
description = "Indicates whether DNS queries made to the Amazon-provided DNS Resolver in this subnet should return synthetic IPv6 addresses for IPv4-only destinations. Default: `true`"
}
variable "private_subnet_enable_dns64" {
type = bool
default = false
description = "Indicates whether DNS queries made to the Amazon-provided DNS Resolver in this subnet should return synthetic IPv6 addresses for IPv4-only destinations. Default: `true`"
}
variable "public_subnet_enable_resource_name_dns_a_record_on_launch" {
type = bool
default = false
description = "Indicates whether to respond to DNS queries for instance hostnames with DNS A records. Default: `false`"
}
variable "private_subnet_enable_resource_name_dns_a_record_on_launch" {
type = bool
default = false
description = "Indicates whether to respond to DNS queries for instance hostnames with DNS A records. Default: `false`"
}
variable "public_subnet_enable_resource_name_dns_aaaa_record_on_launch" {
type = bool
default = false
description = "Indicates whether to respond to DNS queries for instance hostnames with DNS AAAA records. Default: `true`"
}
variable "private_subnet_enable_resource_name_dns_aaaa_record_on_launch" {
type = bool
default = false
description = "Indicates whether to respond to DNS queries for instance hostnames with DNS AAAA records. Default: `true`"
}
variable "public_inbound_acl_rules" {
type = list(map(string))
default = [
{
rule_number = 100
rule_action = "allow"
from_port = 0
to_port = 0
protocol = "-1"
cidr_block = "0.0.0.0/0"
},
]
description = "Public subnets inbound network ACLs"
}
variable "public_outbound_acl_rules" {
type = list(map(string))
default = [
{
rule_number = 100
rule_action = "allow"
from_port = 0
to_port = 0
protocol = "-1"
cidr_block = "0.0.0.0/0"
},
]
description = "Public subnets outbound network ACLs"
}
variable "private_inbound_acl_rules" {
type = list(map(string))
default = [
{
rule_number = 100
rule_action = "deny"
from_port = 0
to_port = 0
protocol = "-1"
cidr_block = "0.0.0.0/0"
},
]
description = "Private subnets inbound network ACLs"
}
variable "private_outbound_acl_rules" {
type = list(map(string))
default = [
{
rule_number = 100
rule_action = "deny"
from_port = 0
to_port = 0
protocol = "-1"
cidr_block = "0.0.0.0/0"
},
]
description = "Private subnets outbound network ACLs"
}
variable "nat_gateway_destination_cidr_block" {
type = string
default = "0.0.0.0/0"
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"
}
variable "public_rt_ipv4_destination_cidr" {
type = string
default = "0.0.0.0/0"
description = "The destination ipv4 CIDR block."
}
variable "public_rt_ipv6_destination_cidr" {
type = string
default = "::/0"
description = "The destination ipv6 CIDR block."
}