-
Notifications
You must be signed in to change notification settings - Fork 3
/
Copy pathvars.tf
319 lines (279 loc) · 8.73 KB
/
vars.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
variable "network_name" {
type = string
description = "Name to be used for VPC resources"
}
variable "cidr_block" {
type = string
default = "10.0.0.0/16"
description = "CIDR block for VPC"
}
variable "additional_cidr_blocks" {
type = list(string)
default = []
description = "Additional CIDR block to assicate with VPC"
}
variable "enable_dns_support" {
type = bool
default = true
description = "Whether to enable/disable DNS support in the VPC"
}
variable "enable_dns_hostnames" {
type = bool
default = true
description = "Whether to enable/disable DNS hostnames in the VPC"
}
variable "instance_tenancy" {
type = string
default = "default"
description = "Tenancy option for instances launched into the VPC. **Valid values:** default, dedicated"
}
variable "assign_ipv6_cidr_block" {
type = bool
default = false
description = "Requests an Amazon-provided IPv6 CIDR block with a /56 prefix length for the VPC"
}
variable "azs" {
type = list(string)
default = [
"us-east-1a",
"us-east-1b",
]
description = "List of availability zones to be used for launching resources"
}
variable "map_public_ip_for_public_subnet" {
type = bool
default = true
description = "Auto assign public IP to resources launched in public subnet"
}
variable "pub_subnet_mask" {
type = number
default = 24
description = "Subnet mask to use for public subnet"
}
variable "pvt_subnet_mask" {
type = number
default = 24
description = "Subnet mask to use for private subnet"
}
variable "data_subnet_mask" {
type = number
default = 24
description = "Subnet mask to use for data subnet"
}
variable "create_pvt_nat" {
type = bool
default = true
description = "Whether to create NAT gateway for private subnet"
}
variable "pvt_nat_ha_mode" {
type = bool
default = true
description = "This option will create NAT gateway for private subnet in each availability zone"
}
variable "pvt_nat_eip_id" {
type = list(string)
default = []
description = "List of allocation ID of EIP to attach to NAT gateway in private subnet. If creating NAT in HA mode count of EIP ID must match AZ count otherwise, count of EIP ID should be 1. Leave it blank to create new EIP(s)"
}
variable "create_data_nat" {
type = bool
default = true
description = "Whether to create NAT gateway for data subnet"
}
variable "data_nat_ha_mode" {
type = bool
default = true
description = "This option will create NAT gateway for data subnet in each availability zone"
}
variable "data_nat_eip_id" {
type = list(string)
default = []
description = "List of allocation ID of EIP to attach to NAT gateway in data subnet. If creating NAT in HA mode count of EIP ID must match AZ count otherwise, count of EIP ID should be 1. Leave it blank to create new EIP(s)"
}
variable "pub_nacl_ingress" {
type = list(any)
default = [
{
rule_no = 100
protocol = "-1"
cidr_block = "0.0.0.0/0"
ipv6_cidr_block = null
icmp_type = null
icmp_code = null
from_port = 0
to_port = 0
action = "allow"
}
]
description = "List of ingress rules to attach to public subnet NACL"
}
variable "pub_nacl_egress" {
type = list(any)
default = [
{
rule_no = 100
protocol = "-1"
cidr_block = "0.0.0.0/0"
ipv6_cidr_block = null
icmp_type = null
icmp_code = null
from_port = 0
to_port = 0
action = "allow"
}
]
description = "List of egress rules to attach to public subnet NACL"
}
variable "pvt_nacl_ingress" {
type = list(any)
default = [
{
rule_no = 100
protocol = "-1"
cidr_block = "0.0.0.0/0"
ipv6_cidr_block = null
icmp_type = null
icmp_code = null
from_port = 0
to_port = 0
action = "allow"
}
]
description = "List of ingress rules to attach to private subnet NACL"
}
variable "pvt_nacl_egress" {
type = list(any)
default = [
{
rule_no = 100
protocol = "-1"
cidr_block = "0.0.0.0/0"
ipv6_cidr_block = null
icmp_type = null
icmp_code = null
from_port = 0
to_port = 0
action = "allow"
}
]
description = "List of egress rules to attach to private subnet NACL"
}
variable "data_nacl_ingress" {
type = list(any)
default = [
{
rule_no = 100
protocol = "-1"
cidr_block = "0.0.0.0/0"
ipv6_cidr_block = null
icmp_type = null
icmp_code = null
from_port = 0
to_port = 0
action = "allow"
}
]
description = "List of ingress rules to attach to data subnet NACL"
}
variable "data_nacl_egress" {
type = list(any)
default = [
{
rule_no = 100
protocol = "-1"
cidr_block = "0.0.0.0/0"
ipv6_cidr_block = null
icmp_type = null
icmp_code = null
from_port = 0
to_port = 0
action = "allow"
}
]
description = "List of egress rules to attach to data subnet NACL"
}
variable "create_flow_logs" {
type = bool
default = true
description = "Whether to enable flow logs for VPC"
}
variable "flow_logs_destination" {
type = string
default = "cloud-watch-logs"
description = "Destination to store VPC flow logs. Possible values: s3, cloud-watch-logs"
}
variable "flow_logs_log_format" {
type = string
default = null
description = "Specify the fields using the $${field-id} format, separated by spaces to include in the flow log record. E.g: $${version} $${account-id}. Leave it to `null` to use the AWS default format. Refer to [AWS doc](https://docs.aws.amazon.com/vpc/latest/userguide/flow-logs.html#flow-logs-fields) to learn what all fields can be included in the flow logs"
}
variable "flow_logs_retention" {
type = number
default = 90
description = "Time period for which you want to retain VPC flow logs in CloudWatch log group. Default is 0 which means logs never expire. Possible values are 1, 3, 5, 7, 14, 30, 60, 90, 120, 150, 180, 365, 400, 545, 731, 1827, 3653"
}
variable "flow_logs_cw_log_group_arn" {
type = string
default = ""
description = "ARN of CloudWatch Log Group to use for storing VPC flow logs"
}
variable "cw_log_group_kms_key_arn" {
type = string
default = null
description = "ARN of KMS key to use for Cloudwatch Log Group SSE"
}
variable "flow_logs_bucket_arn" {
type = string
default = ""
description = "ARN of S3 to use for storing VPC flow logs"
}
variable "flow_logs_s3_file_format" {
type = string
default = "plain-text"
description = "The format of log file delivered to the S3 bucket. **Valid values:** plain-text, parquet"
}
variable "flow_logs_s3_hive_compatible_partitions" {
type = bool
default = false
description = "Whether to use Hive-compatible S3 prefixes to simplify the loading of new data into your Hive-compatible tools"
}
variable "flow_logs_s3_per_hour_partition" {
type = bool
default = true
description = "Partition your logs per hour to reduce your query costs and get faster response if you have a large volume of logs and typically run queries targeted to a specific hour timeframe. Setting it to `false` will partition logs every 24 hours"
}
variable "s3_force_destroy" {
type = bool
default = true
description = "Delete bucket content before deleting bucket"
}
variable "s3_kms_key" {
type = string
default = "alias/aws/s3"
description = "Alias/ID/ARN of KMS key to use for encrypting S3 bucket content"
}
variable "create_private_zone" {
type = bool
default = false
description = "Whether to create private hosted zone for VPC"
}
variable "private_zone_domain" {
type = string
default = "server.internal.com"
description = "Domain name to be used for private hosted zone"
}
variable "create_sgs" {
type = bool
default = false
description = "Whether to create few widely used security groups for controlling traffic"
}
variable "tags" {
type = map(any)
default = {}
description = "Map of key-value pair to associate with resources"
}
variable "add_eks_tags" {
type = bool
default = false
description = "Add `kubernetes.io/role/elb: 1` and `kubernetes.io/role/internal-elb: 1` tags to public and private subnets respectively for load balancer"
}