-
Notifications
You must be signed in to change notification settings - Fork 3
/
Copy pathvariables.tf
321 lines (281 loc) · 9.87 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
#=============#
# Label #
#=============#
variable "prefix" {
type = string
description = <<-EOL
String or prefix that would be used to tag/Name all the resources created by this module, this prefix will be generated
by obytes/terraform-aws-tag public module
EOL
}
variable "name" {
type = string
default = null
description = "The name of the service/solution such as vpc, ec2 that would be append to the prefix"
}
variable "additional_tags" {
type = map(string)
default = {}
description = "Additional Tags, tags which can be accessed by module.<name>.tags_as_list not added to <module>.<name>.<tags>"
}
variable "delimiter" {
type = string
default = null
description = <<-EOL
Delimiter to be used between `project_name`, `environment`, `region` and, `name`.
Defaults to `-` (hyphen). Set to `""` to use no delimiter at all.
EOL
}
#=============#
# V P C #
#=============#
variable "enabled" {
type = string
default = true
description = "A boolean to enable or disable creation of VPC resources"
}
variable "include_all_azs" {
type = bool
default = true
description = <<-EOL
Boolean, weather to include all Availability Zones in the region where the provider is running
Default is `true`, set this to `false` if you would like to have specific azs
EOL
}
variable "azs_list_names" {
type = list(string)
default = []
description = "A list to include all the AZs you would like to configure such as `us-east-1a`, `us-east-1b`"
}
variable "enable_nat_gateway" {
type = bool
default = true
description = "Should be true if you want to provision NAT Gateways for each of your private networks"
}
variable "single_nat_gateway" {
type = bool
default = true
description = <<-EOL
Should be true if you want to provision a single shared NAT Gateway across all of your private networks
EOL
}
variable "nat_gateway_per_az" {
type = bool
default = false
description = "Should be true if you want only one NAT Gateway per availability zone."
}
variable "enable_internet_gateway" {
type = bool
default = false
description = <<-EOL
IGW, This boolean variables controls the creation of Internet Gateway
For IGW to be created this variable and var.create_public_subnets should set to true
EOL
}
variable "create_private_subnets" {
type = bool
default = true
description = "Ability to create private subnets in all configured AZs"
}
variable "create_public_subnets" {
type = bool
default = false
description = <<-EOL
Ability to create private subnets in all configured AZs, if this set to true
the `enable_internet_gateway` should also be true for the subnets to be associated to IGW
EOL
}
variable "create_custom_security_group" {
type = bool
default = true
description = <<-EOL
Boolean, to enable the creation of a custom default_security_group
if set to `false` the AWS default VPC security rule will be applied, for more reference https://docs.aws.amazon.com/vpc/latest/userguide/VPC_SecurityGroups.html#DefaultSecurityGroup
if set to `true` a new default security group will be created with only `egress` traffic allowed
EOL
}
variable "cidr_block" {
type = string
default = null
description = "VPC CIDR Block, The allowed block size is between a /16 netmask (65,536 IP addresses) and /28 netmask (16 IP addresses)."
validation {
condition = contains((regex("(^\\d{1,3}\\.\\d{1,3}\\.\\d{1,3}\\.\\d{1,3}\\/((1[6-9])||(2[0-9]))$)", var.cidr_block)), var.cidr_block)
error_message = "Error, The CIDR is not valid, The allowed block size is between a /16 netmask (65,536 IP addresses) and /28 netmask (16 IP addresses)."
}
}
variable "enable_dns_hostnames" {
type = bool
default = false
description = "A boolean flag to enable/disable DNS hostnames in the VPC. Defaults false."
}
variable "enable_dns_support" {
type = bool
default = true
description = "A boolean flag to enable/disable DNS support in the VPC. Defaults true."
}
variable "enable_ipv6_cidr_block" {
type = bool
default = false
description = <<-EOL
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. Default is `false`
EOL
}
variable "default_security_group_ingress" {
type = list(map(string))
default = []
description = <<-EOL
Ingress Rules, List of maps of ingress rules to set on the default security group
Example
[
{
from_port = 80
to_port = 80
protocol = "tcp" #https://registry.terraform.io/providers/hashicorp/aws/latest/docs/resources/default_security_group#protocol
cidr_blocks = ["0.0.0.0/0"]
description = "Ingress Rule to Allow port 80 protocol TCP from Anywhere"
self = true|false # Whether the security group itself will be added as a source to this egress rule.
}
]
EOL
}
variable "default_security_group_egress" {
type = list(map(string))
default = [
{
from_port = "0"
to_port = "0"
protocol = "-1"
cidr_blocks = "0.0.0.0/0"
}
]
description = <<-EOL
Egress Rules, List of maps of ingress rules to set on the default security group
Default egress rule is to allow all outgoing connections on any protocol.
Example
[
{
from_port = 80
to_port = 80
protocol = "tcp" #https://registry.terraform.io/providers/hashicorp/aws/latest/docs/resources/default_security_group#protocol
cidr_blocks = ["0.0.0.0/0"]
description = "Ingress Rule to Allow port 80 protocol TCP from Anywhere"
self = true|false # Whether the security group itself will be added as a source to this egress rule.
}
]
EOL
}
variable "max_subnet_count" {
type = number
default = 0
description = "A Number to indicate the max subnets to be created, if not set it will create one subnet/az"
}
variable "nat_eips_list" {
type = list(string)
default = []
description = "A List, of NAT IPs to be used by the NAT_GW"
}
variable "manage_default_route_table" {
type = bool
default = true
description = "Should be true, to manage the default route table"
}
variable "additional_default_route_table_routes" {
type = list(map(string))
default = []
description = <<-EOL
List, of routes to be added to the default route table ID
Example,
[
{
cidr_block = "172.17.18.19/30" # Required
ipv6_cidr_block = "::/0" # Optional
destination_prefix_list_id = "pl-0570a1d2d725c16be" # Optional
#One of the following target arguments must be supplied:
egress_only_gateway_id = ""
gateway_id = ""
instance_id = ""
nat_gateway_id = ""
vpc_peering_connection_id = ""
vpc_endpoint_id = ""
transit_gateway_id = ""
network_interface_id = ""
}
]
EOL
}
variable "additional_default_route_table_tags" {
type = map(string)
default = null
description = "Additional, map of tags to be added to the `default_route_table` tags"
}
variable "map_public_ip_on_lunch" {
type = bool
default = false
description = "(Optional) Specify true to indicate that instances launched into the subnet should be assigned a public IP address. Default is false."
}
variable "additional_public_route_tags" {
type = map(string)
default = null
description = "Additional, map of tags to be added to the public `aws_route_table` tags"
}
variable "additional_private_route_tags" {
type = map(string)
default = null
description = "Additional, map of tags to be added to the private `aws_route_table` tags"
}
variable "additional_private_subnet_tags" {
type = map(string)
default = null
description = "Additional, map of tags to be added to the private `aws_subnet` resources"
}
variable "additional_public_subnet_tags" {
type = map(string)
default = null
description = "Additional, map of tags to be added to the private `aws_subnets` resources"
}
variable "route_create_timeout" {
type = string
default = "5m"
description = "A timeout for the aws_route_table creation, default is 5m"
}
variable "route_delete_timeout" {
type = string
default = "5m"
description = "A timeout for the aws_route_table deletion, default is 5m"
}
variable "vpc_domain_name_servers" {
type = list(string)
default = ["AmazonProvidedDNS"]
description = "(Optional) List of name servers to configure in /etc/resolv.conf. If you want to use the default AWS nameservers you should set this to AmazonProvidedDNS."
}
variable "vpc_dhcp_domain_name" {
type = string
default = null
description = " (Optional) the suffix domain name to use by default when resolving non Fully Qualified Domain Names. In other words, this is what ends up being the search value in the /etc/resolv.conf file."
}
variable "vpc_dhcp_ntp_servers" {
type = list(string)
default = []
description = "(Optional) List of NTP servers to configure."
}
variable "vpc_dhcp_netbios_name_servers" {
type = list(string)
default = []
description = " (Optional) List of NETBIOS name servers."
}
variable "vpc_dhcp_netbios_node_type" {
type = number
default = null
description = "(Optional) The NetBIOS node type (1, 2, 4, or 8). AWS recommends to specify 2 since broadcast and multicast are not supported in their network. For more information about these node types, see RFC 2132."
}
variable "tgw_route_table_id" {
type = string
default = null
description = "Transit GW route table ID to be added as a destination for the VPC route tables"
}
variable "transit_routes" {
type = list(string)
default = []
description = "The destination prefixes (CIDR blocks) that should be forwarded to transit gateway"
}