-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathvaribles.tf
589 lines (493 loc) · 19.2 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
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
582
583
584
585
586
587
588
589
###############################################################################
# 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 "vpc_flow_logs_kms_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 = {}
}
###############################################################################
# AWS cloud map
###############################################################################
###############################################################################
# Namespace
###############################################################################
variable "namespace_name" {
description = "Name of AWS cloud map namespace"
type = string
default = ""
}
###############################################################################
# ECS Cluster
###############################################################################
variable "cluster_configuration" {
description = "The execute command configuration for the cluster"
type = any
default = {}
}
###############################################################################
# CloudWatch Log Group
###############################################################################
variable "cluster_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
}
###############################################################################
# KMS key statement for CloudWatch log groups for ECS Cluster logs
###############################################################################
variable "ecs_cluster_logs_kms_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 = {}
}
###############################################################################
# ECS Cluster Capacity Providers
###############################################################################
variable "fargate_capacity_providers" {
description = "Map of Fargate capacity provider definitions to use for the cluster"
type = any
default = {}
}
###############################################################################
# ECS service
###############################################################################
variable "load_balancer" {
description = "Configuration block for load balancers"
type = any
default = {}
}
###############################################################################
# Task Definition
###############################################################################
variable "container_definitions" {
description = "A map of valid [container definitions](http://docs.aws.amazon.com/AmazonECS/latest/APIReference/API_ContainerDefinition.html). Please note that you should only provide values that are part of the container definition document"
type = any
default = {}
}
variable "network_mode" {
description = "Docker networking mode to use for the containers in the task. Valid values are `none`, `bridge`, `awsvpc`, and `host`"
type = string
default = "awsvpc"
}
variable "cpu" {
description = "Number of cpu units used by the task. If the `requires_compatibilities` is `FARGATE` this field is required"
type = number
default = 1024
}
variable "memory" {
description = "Amount (in MiB) of memory used by the task. If the `requires_compatibilities` is `FARGATE` this field is required"
type = number
default = 2048
}
###############################################################################
# Task Execution - IAM Role
###############################################################################
variable "task_exec_iam_role_name" {
description = "Name to use on IAM role created"
type = string
default = null
}
variable "task_exec_iam_role_use_name_prefix" {
description = "Determines whether the IAM role name (`task_exec_iam_role_name`) is used as a prefix"
type = bool
default = true
}
variable "task_exec_iam_role_tags" {
description = "A map of additional tags to add to the IAM role created"
type = map(string)
default = {}
}
variable "task_exec_ssm_param_arns" {
description = "List of SSM parameter ARNs the task execution role will be permitted to get/read"
type = list(string)
default = ["arn:aws:ssm:*:*:parameter/*"]
}
variable "task_exec_secret_arns" {
description = "List of SecretsManager secret ARNs the task execution role will be permitted to get/read"
type = list(string)
default = ["arn:aws:secretsmanager:*:*:secret:*"]
}
variable "task_exec_iam_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 = {}
}
###############################################################################
# Tasks - IAM role
###############################################################################
variable "tasks_iam_role_name" {
description = "Name to use on IAM role created"
type = string
default = null
}
variable "tasks_iam_role_use_name_prefix" {
description = "Determines whether the IAM role name (`tasks_iam_role_name`) is used as a prefix"
type = bool
default = true
}
variable "tasks_iam_role_tags" {
description = "A map of additional tags to add to the IAM role created"
type = map(string)
default = {}
}
variable "tasks_iam_role_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 = {}
}
###############################################################################
# ECS Service SG
###############################################################################
variable "security_group_name" {
description = "Name to use on security group created"
type = string
default = null
}
variable "security_group_use_name_prefix" {
description = "Determines whether the security group name (`security_group_name`) is used as a prefix"
type = bool
default = true
}
variable "security_group_description" {
description = "Description of the security group created"
type = string
default = null
}
variable "service_security_group_rules" {
description = "Security group rules to add to the security group created"
type = any
default = {
ingress_all_http = {
type = "ingress"
from_port = 0
to_port = 65535
protocol = "-1"
description = "HTTP web traffic"
cidr_blocks = ["0.0.0.0/0"]
}
egress_all = {
type = "egress"
from_port = 0
to_port = 65535
protocol = "-1"
cidr_blocks = ["0.0.0.0/0"]
}
}
}
variable "security_group_tags" {
description = "A map of additional tags to add to the security group created"
type = map(string)
default = {}
}
###############################################################################
# KMS key for CloudWatch log groups for ECS Service logs
###############################################################################
variable "ecs_service_logs_kms_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 = {}
}
###############################################################################
# ALB
###############################################################################
variable "https_listeners" {
description = "A list of maps describing the HTTPS listeners for this ALB. Required key/values: port, certificate_arn. Optional key/values: ssl_policy (defaults to ELBSecurityPolicy-2016-08), target_group_index (defaults to https_listeners[count.index])"
type = any
default = []
}
variable "http_tcp_listeners" {
description = "A list of maps describing the HTTP listeners or TCP ports for this ALB. Required key/values: port, protocol. Optional key/values: target_group_index (defaults to http_tcp_listeners[count.index])"
type = any
default = [
{
port = 80
protocol = "HTTP"
target_group_index = 0
}
]
}
variable "https_listener_rules" {
description = "A list of maps describing the Listener Rules for this ALB. Required key/values: actions, conditions. Optional key/values: priority, https_listener_index (default to https_listeners[count.index])"
type = any
default = []
}
variable "http_tcp_listener_rules" {
description = "A list of maps describing the Listener Rules for this ALB. Required key/values: actions, conditions. Optional key/values: priority, http_tcp_listener_index (default to http_tcp_listeners[count.index])"
type = any
default = []
}
variable "access_logs" {
description = "Map containing access logging configuration for load balancer."
type = map(string)
default = {}
}
variable "subnets" {
description = "A list of subnets to associate with the load balancer. e.g. ['subnet-1a2b3c4d','subnet-1a2b3c4e','subnet-1a2b3c4f']"
type = list(string)
default = null
}
variable "target_groups" {
description = "A list of maps containing key/value pairs that define the target groups to be created. Order of these maps is important and the index of these are to be referenced in listener definitions. Required key/values: name, backend_protocol, backend_port"
type = any
default = []
}
###############################################################################
# ALB SG
###############################################################################
variable "alb_security_group_rules" {
description = "Security group rules to add to the security group created"
type = any
default = {
ingress_all_http = {
type = "ingress"
from_port = 0
to_port = 0
protocol = "-1"
cidr_blocks = ["0.0.0.0/0"]
}
egress_all = {
type = "egress"
from_port = 0
to_port = 0
protocol = "-1"
cidr_blocks = ["0.0.0.0/0"]
}
}
}
###############################################################################
# ALB S3 logging Bucket
###############################################################################
variable "attach_elb_log_delivery_policy" {
description = "Controls if S3 bucket should have ELB log delivery policy attached"
type = bool
default = false
}
variable "attach_lb_log_delivery_policy" {
description = "Controls if S3 bucket should have ALB/NLB log delivery policy attached"
type = bool
default = false
}
variable "alb_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 "alb_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 "acl" {
description = "(Optional) The canned ACL to apply. Conflicts with `grant`"
type = string
default = null
}
variable "alb_tags" {
description = "(Optional) A mapping of tags to assign to the bucket."
type = map(string)
default = {}
}
variable "force_destroy" {
description = "(Optional, Default:false ) A boolean that indicates all objects should be deleted from the bucket so that the bucket can be destroyed without error. These objects are not recoverable."
type = bool
default = false
}
variable "versioning" {
description = "Map containing versioning configuration."
type = map(string)
default = {}
}
variable "alb_logging" {
description = "Map containing access bucket logging configuration."
type = map(string)
default = {}
}
variable "lifecycle_rule" {
description = "List of maps containing configuration of object lifecycle management."
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 = {}
}