-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathvaribles.tf
389 lines (324 loc) · 12.5 KB
/
varibles.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
###############################################################################
# General variables
###############################################################################
variable "region" {
type = string
default = "eu-west-2"
}
variable "project" {
description = "Project tag in which the AWS infrastructure belongs"
type = string
default = ""
}
variable "name" {
description = "Name to be used on all the resources as identifier"
type = string
default = ""
}
###############################################################################
# VPC
###############################################################################
variable "vpc_cidr" {
type = string
default = "10.0.0.0/16"
}
###############################################################################
# Public subnets
###############################################################################
variable "public_inbound_acl_rules" {
description = "Public subnets inbound network ACLs"
type = list(map(string))
default = [
{
rule_number = 100
rule_action = "allow"
from_port = 80
to_port = 80
protocol = "-1"
cidr_block = "0.0.0.0/0"
},
]
}
variable "public_outbound_acl_rules" {
description = "Public subnets outbound network ACLs"
type = list(map(string))
default = [
{
rule_number = 100
rule_action = "allow"
from_port = 80
to_port = 80
protocol = "-1"
cidr_block = "0.0.0.0/0"
},
]
}
###############################################################################
# Private subnets
###############################################################################
variable "private_inbound_acl_rules" {
description = "Private subnets inbound network ACLs"
type = list(map(string))
default = [
{
rule_number = 100
rule_action = "allow"
from_port = 80
to_port = 80
protocol = "-1"
cidr_block = "0.0.0.0/0"
},
]
}
variable "private_outbound_acl_rules" {
description = "Private subnets outbound network ACLs"
type = list(map(string))
default = [
{
rule_number = 100
rule_action = "allow"
from_port = 80
to_port = 80
protocol = "-1"
cidr_block = "0.0.0.0/0"
},
]
}
###############################################################################
# KMS key for CloudWatch log groups for VPC flow logs
###############################################################################
variable "key_statements" {
description = "A map of IAM policy [statements](https://registry.terraform.io/providers/hashicorp/aws/latest/docs/data-sources/iam_policy_document#statement) for custom permission usage"
type = any
default = {}
}
###############################################################################
# VPC endpoints SG
###############################################################################
###############################################################################
# Ingress
###############################################################################
variable "ingress_with_cidr_blocks" {
description = "List of ingress rules to create where 'cidr_blocks' is used"
type = list(map(string))
default = [
{
rule = "all-all"
description = "all ingress HTTPS"
cidr_blocks = "0.0.0.0/0"
},
]
}
###############################################################################
# Egress
###############################################################################
variable "egress_with_cidr_blocks" {
description = "List of egress rules to create where 'cidr_blocks' is used"
type = list(map(string))
default = [
{
rule = "all-all"
description = "All egress HTTPS"
cidr_blocks = "0.0.0.0/0"
},
]
}
###############################################################################
# VPC endpoints
###############################################################################
###############################################################################
# Endpoints
###############################################################################
variable "endpoints" {
description = "A map of interface and/or gateway endpoints containing their properties and configurations"
type = any
default = {}
}
###############################################################################
# CloudTrail
###############################################################################
variable "is_multi_region_trail" {
type = bool
default = true
description = "Specifies whether the trail is created in the current region or in all regions"
}
variable "include_global_service_events" {
type = bool
default = false
description = "Specifies whether the trail is publishing events from global services such as IAM to the log files"
}
variable "insight_selector" {
type = list(object({
insight_type = string
}))
description = "Specifies an insight selector for type of insights to log on a trail"
default = []
}
variable "event_selector" {
type = list(object({
include_management_events = bool
read_write_type = string
data_resource = list(object({
type = string
values = list(string)
}))
}))
description = "Specifies an event selector for enabling data event logging. See: https://www.terraform.io/docs/providers/aws/r/cloudtrail.html for details on this variable"
default = []
}
###############################################################################
# CT S3 logging Bucket
###############################################################################
variable "ct_bucket" {
description = "(Optional, Forces new resource) The name of the bucket. If omitted, Terraform will assign a random, unique name."
type = string
default = null
}
variable "ct_bucket_prefix" {
description = "(Optional, Forces new resource) Creates a unique bucket name beginning with the specified prefix. Conflicts with bucket."
type = string
default = null
}
variable "ct_tags" {
description = "(Optional) A mapping of tags to assign to the bucket."
type = map(string)
default = {}
}
variable "ct_logging" {
description = "Map containing access bucket logging configuration."
type = map(string)
default = {}
}
###############################################################################
# EKS Cluster
###############################################################################
variable "cluster_version" {
type = string
default = "1.27"
}
variable "cluster_tags" {
description = "A map of additional tags to add to the cluster"
type = map(string)
default = {}
}
###############################################################################
# KMS key for EKS cluster encryption
###############################################################################
variable "kms_key_owners" {
description = "A list of IAM ARNs for those who will have full key permissions (`kms:*`)"
type = list(string)
default = []
}
variable "kms_key_administrators" {
description = "A list of IAM ARNs for [key administrators](https://docs.aws.amazon.com/kms/latest/developerguide/key-policy-default.html#key-policy-default-allow-administrators). If no value is provided, the current caller identity is used to ensure at least one key admin is available"
type = list(string)
default = []
}
variable "kms_key_users" {
description = "A list of IAM ARNs for [key users](https://docs.aws.amazon.com/kms/latest/developerguide/key-policy-default.html#key-policy-default-allow-users)"
type = list(string)
default = []
}
variable "kms_key_service_users" {
description = "A list of IAM ARNs for [key service users](https://docs.aws.amazon.com/kms/latest/developerguide/key-policy-default.html#key-policy-service-integration)"
type = list(string)
default = []
}
variable "kms_key_source_policy_documents" {
description = "List of IAM policy documents that are merged together into the exported document. Statements must have unique `sid`s"
type = list(string)
default = []
}
###############################################################################
# EKS Cluster CloudWatch Log Group
###############################################################################
variable "cloudwatch_log_group_kms_key_id" {
description = "If a KMS Key ARN is set, this key will be used to encrypt the corresponding log group. Please be sure that the KMS Key has an appropriate key policy (https://docs.aws.amazon.com/AmazonCloudWatch/latest/logs/encrypt-log-data-kms.html)"
type = string
default = null
}
###############################################################################
# EKS Cluster Security Group
###############################################################################
variable "vpc_id" {
description = "ID of the VPC where the cluster security group will be provisioned"
type = string
default = null
}
variable "cluster_security_group_name" {
description = "Name to use on cluster security group created"
type = string
default = null
}
variable "cluster_security_group_additional_rules" {
description = "List of additional security group rules to add to the cluster security group created. Set `source_node_security_group = true` inside rules to set the `node_security_group` as source"
type = any
default = {}
}
variable "cluster_security_group_tags" {
description = "A map of additional tags to add to the cluster security group created"
type = map(string)
default = {}
}
###############################################################################
# EKS Cluster Node Security Group
###############################################################################
variable "node_security_group_name" {
description = "Name to use on node security group created"
type = string
default = null
}
variable "node_security_group_additional_rules" {
description = "List of additional security group rules to add to the node security group created. Set `source_cluster_security_group = true` inside rules to set the `cluster_security_group` as source"
type = any
default = {}
}
variable "node_security_group_tags" {
description = "A map of additional tags to add to the node security group created"
type = map(string)
default = {}
}
###############################################################################
# EKS Cluster IAM Role
###############################################################################
variable "iam_role_name" {
description = "Name to use on IAM role created"
type = string
default = null
}
variable "iam_role_permissions_boundary" {
description = "ARN of the policy that is used to set the permissions boundary for the IAM role"
type = string
default = null
}
variable "iam_role_tags" {
description = "A map of additional tags to add to the IAM role created"
type = map(string)
default = {}
}
variable "cluster_encryption_policy_name" {
description = "Name to use on cluster encryption policy created"
type = string
default = null
}
variable "cluster_encryption_policy_tags" {
description = "A map of additional tags to add to the cluster encryption policy created"
type = map(string)
default = {}
}
###############################################################################
# EKS Addons
###############################################################################
variable "cluster_addons" {
description = "Map of cluster addon configurations to enable for the cluster. Addon name can be the map keys or set with `name`"
type = any
default = {}
}
###############################################################################
# EKS Managed Node Group
###############################################################################
variable "eks_managed_node_groups" {
description = "Map of EKS managed node group definitions to create"
type = any
default = {}
}