forked from GMADLA/terraform-aws-ecs-web-app
-
Notifications
You must be signed in to change notification settings - Fork 0
/
variables.tf
661 lines (549 loc) · 19.9 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
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
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
variable "name" {
type = "string"
description = "Name (unique identifier for app or service)"
}
variable "namespace" {
type = "string"
description = "Namespace (e.g. `eg` or `cp`)"
}
variable "delimiter" {
type = "string"
description = "The delimiter to be used in labels"
default = "-"
}
variable "stage" {
type = "string"
description = "Stage (e.g. `prod`, `dev`, `staging`)"
}
variable "attributes" {
type = "list"
description = "List of attributes to add to label"
default = []
}
variable "tags" {
type = "map"
description = "Map of key-value pairs to use for tags"
default = {}
}
variable "codepipeline_enabled" {
type = "string"
description = "A boolean to enable/disable AWS Codepipeline and ECR"
default = "true"
}
variable "container_image" {
type = "string"
description = "The default container image to use in container definition"
default = "cloudposse/default-backend"
}
variable "container_cpu" {
type = "string"
description = "The vCPU setting to control cpu limits of container. (If FARGATE launch type is used below, this must be a supported vCPU size from the table here: https://docs.aws.amazon.com/AmazonECS/latest/developerguide/task-cpu-memory-error.html)"
default = "256"
}
variable "container_memory" {
type = "string"
description = "The amount of RAM to allow container to use in MB. (If FARGATE launch type is used below, this must be a supported Memory size from the table here: https://docs.aws.amazon.com/AmazonECS/latest/developerguide/task-cpu-memory-error.html)"
default = "512"
}
variable "container_memory_reservation" {
type = "string"
description = "The amount of RAM (Soft Limit) to allow container to use in MB. This value must be less than container_memory if set"
default = ""
}
variable "container_port" {
type = "string"
description = "The port number on the container bound to assigned host_port"
default = "80"
}
variable "port_mappings" {
type = "list"
description = "The port mappings to configure for the container. This is a list of maps. Each map should contain \"containerPort\", \"hostPort\", and \"protocol\", where \"protocol\" is one of \"tcp\" or \"udp\". If using containers in a task with the awsvpc or host network mode, the hostPort can either be left blank or set to the same value as the containerPort"
default = [{
"containerPort" = 80
"hostPort" = 80
"protocol" = "tcp"
}]
}
variable "desired_count" {
type = "string"
description = "The desired number of tasks to start with. Set this to 0 if using DAEMON Service type. (FARGATE does not suppoert DAEMON Service type)"
default = "1"
}
variable "host_port" {
type = "string"
description = "The port number to bind container_port to on the host"
default = ""
}
variable "launch_type" {
type = "string"
description = "The ECS launch type (valid options: FARGATE or EC2)"
default = "FARGATE"
}
variable "blue_green_enabled" {
type = "string"
description = "A boolean to enable blue green deployment"
default = "false"
}
variable "environment" {
type = "list"
description = "The environment variables for the task definition. This is a list of maps"
default = []
}
variable "protocol" {
type = "string"
description = "The protocol used for the port mapping. Options: `tcp` or `udp`"
default = "tcp"
}
variable "healthcheck" {
type = "map"
description = "A map containing command (string), interval (duration in seconds), retries (1-10, number of times to retry before marking container unhealthy, and startPeriod (0-300, optional grace period to wait, in seconds, before failed healthchecks count toward retries)"
default = {}
}
variable "health_check_grace_period_seconds" {
type = "string"
description = "Seconds to ignore failing load balancer health checks on newly instantiated tasks to prevent premature shutdown, up to 7200. Only valid for services configured to use load balancers"
default = "0"
}
variable "alb_target_group_arn" {
type = "string"
description = "Pass target group down to module"
default = ""
}
variable "alb_target_group_alarms_enabled" {
type = "string"
description = "A boolean to enable/disable CloudWatch Alarms for ALB Target metrics"
default = "false"
}
variable "alb_target_group_alarms_3xx_threshold" {
type = "string"
description = "The maximum number of 3XX HTTPCodes in a given period for ECS Service"
default = "25"
}
variable "alb_target_group_alarms_4xx_threshold" {
type = "string"
description = "The maximum number of 4XX HTTPCodes in a given period for ECS Service"
default = "25"
}
variable "alb_target_group_alarms_5xx_threshold" {
type = "string"
description = "The maximum number of 5XX HTTPCodes in a given period for ECS Service"
default = "25"
}
variable "alb_target_group_alarms_response_time_threshold" {
type = "string"
description = "The maximum ALB Target Group response time"
default = "0.5"
}
variable "alb_target_group_alarms_period" {
type = "string"
description = "The period (in seconds) to analyze for ALB CloudWatch Alarms"
default = "300"
}
variable "alb_target_group_alarms_evaluation_periods" {
type = "string"
description = "The number of periods to analyze for ALB CloudWatch Alarms"
default = "1"
}
variable "alb_target_group_alarms_alarm_actions" {
type = "list"
description = "A list of ARNs (i.e. SNS Topic ARN) to execute when ALB Target Group alarms transition into an ALARM state from any other state"
default = []
}
variable "alb_target_group_alarms_ok_actions" {
type = "list"
description = "A list of ARNs (i.e. SNS Topic ARN) to execute when ALB Target Group alarms transition into an OK state from any other state"
default = []
}
variable "alb_target_group_alarms_insufficient_data_actions" {
type = "list"
description = "A list of ARNs (i.e. SNS Topic ARN) to execute when ALB Target Group alarms transition into an INSUFFICIENT_DATA state from any other state"
default = []
}
variable "alb_name" {
type = "string"
description = "Name of the ALB for the Target Group"
default = ""
}
variable "alb_arn_suffix" {
type = "string"
description = "ARN suffix of the ALB for the Target Group"
default = ""
}
variable "alb_ingress_healthcheck_path" {
type = "string"
description = "The path of the healthcheck which the ALB checks"
default = "/"
}
variable "alb_ingress_listener_unauthenticated_priority" {
type = "string"
default = "1000"
description = "The priority for the rules without authentication, between 1 and 50000 (1 being highest priority). Must be different from `alb_ingress_listener_authenticated_priority` since a listener can't have multiple rules with the same priority"
}
variable "alb_ingress_listener_authenticated_priority" {
type = "string"
default = "300"
description = "The priority for the rules with authentication, between 1 and 50000 (1 being highest priority). Must be different from `alb_ingress_listener_unauthenticated_priority` since a listener can't have multiple rules with the same priority"
}
variable "alb_ingress_unauthenticated_hosts" {
type = "list"
default = []
description = "Unauthenticated hosts to match in Hosts header"
}
variable "alb_ingress_authenticated_hosts" {
type = "list"
default = []
description = "Authenticated hosts to match in Hosts header"
}
variable "alb_ingress_unauthenticated_paths" {
type = "list"
default = []
description = "Unauthenticated path pattern to match (a maximum of 1 can be defined)"
}
variable "alb_ingress_authenticated_paths" {
type = "list"
default = []
description = "Authenticated path pattern to match (a maximum of 1 can be defined)"
}
variable "vpc_id" {
type = "string"
description = "The VPC ID where resources are created"
}
variable "aws_logs_region" {
type = "string"
description = "The region for the AWS Cloudwatch Logs group"
}
variable "ecs_alarms_enabled" {
type = "string"
description = "A boolean to enable/disable CloudWatch Alarms for ECS Service metrics"
default = "false"
}
variable "ecs_cluster_arn" {
type = "string"
description = "The ECS Cluster ARN where ECS Service will be provisioned"
}
variable "ecs_cluster_name" {
type = "string"
description = "The ECS Cluster Name to use in ECS Code Pipeline Deployment step"
}
variable "ecs_alarms_cpu_utilization_high_threshold" {
type = "string"
description = "The maximum percentage of CPU utilization average"
default = "80"
}
variable "ecs_alarms_cpu_utilization_high_evaluation_periods" {
type = "string"
description = "Number of periods to evaluate for the alarm"
default = "1"
}
variable "ecs_alarms_cpu_utilization_high_period" {
type = "string"
description = "Duration in seconds to evaluate for the alarm"
default = "300"
}
variable "ecs_alarms_cpu_utilization_high_alarm_actions" {
type = "list"
description = "A list of ARNs (i.e. SNS Topic ARN) to notify on CPU Utilization High Alarm action"
default = []
}
variable "ecs_alarms_cpu_utilization_high_ok_actions" {
type = "list"
description = "A list of ARNs (i.e. SNS Topic ARN) to notify on CPU Utilization High OK action"
default = []
}
variable "ecs_alarms_cpu_utilization_low_threshold" {
type = "string"
description = "The minimum percentage of CPU utilization average"
default = "20"
}
variable "ecs_alarms_cpu_utilization_low_evaluation_periods" {
type = "string"
description = "Number of periods to evaluate for the alarm"
default = "1"
}
variable "ecs_alarms_cpu_utilization_low_period" {
type = "string"
description = "Duration in seconds to evaluate for the alarm"
default = "300"
}
variable "ecs_alarms_cpu_utilization_low_alarm_actions" {
type = "list"
description = "A list of ARNs (i.e. SNS Topic ARN) to notify on CPU Utilization Low Alarm action"
default = []
}
variable "ecs_alarms_cpu_utilization_low_ok_actions" {
type = "list"
description = "A list of ARNs (i.e. SNS Topic ARN) to notify on CPU Utilization Low OK action"
default = []
}
variable "ecs_alarms_memory_utilization_high_threshold" {
type = "string"
description = "The maximum percentage of Memory utilization average"
default = "80"
}
variable "ecs_alarms_memory_utilization_high_evaluation_periods" {
type = "string"
description = "Number of periods to evaluate for the alarm"
default = "1"
}
variable "ecs_alarms_memory_utilization_high_period" {
type = "string"
description = "Duration in seconds to evaluate for the alarm"
default = "300"
}
variable "ecs_alarms_memory_utilization_high_alarm_actions" {
type = "list"
description = "A list of ARNs (i.e. SNS Topic ARN) to notify on Memory Utilization High Alarm action"
default = []
}
variable "ecs_alarms_memory_utilization_high_ok_actions" {
type = "list"
description = "A list of ARNs (i.e. SNS Topic ARN) to notify on Memory Utilization High OK action"
default = []
}
variable "ecs_alarms_memory_utilization_low_threshold" {
type = "string"
description = "The minimum percentage of Memory utilization average"
default = "20"
}
variable "ecs_alarms_memory_utilization_low_evaluation_periods" {
type = "string"
description = "Number of periods to evaluate for the alarm"
default = "1"
}
variable "ecs_alarms_memory_utilization_low_period" {
type = "string"
description = "Duration in seconds to evaluate for the alarm"
default = "300"
}
variable "ecs_alarms_memory_utilization_low_alarm_actions" {
type = "list"
description = "A list of ARNs (i.e. SNS Topic ARN) to notify on Memory Utilization Low Alarm action"
default = []
}
variable "ecs_alarms_memory_utilization_low_ok_actions" {
type = "list"
description = "A list of ARNs (i.e. SNS Topic ARN) to notify on Memory Utilization Low OK action"
default = []
}
variable "ecs_security_group_ids" {
type = "list"
description = "Additional Security Group IDs to allow into ECS Service"
default = []
}
variable "ecs_private_subnet_ids" {
type = "list"
description = "List of Private Subnet IDs to provision ECS Service onto"
}
variable "github_oauth_token" {
type = "string"
description = "GitHub Oauth Token with permissions to access private repositories"
default = ""
}
variable "github_webhooks_token" {
type = "string"
description = "GitHub Webhooks Token with permissions to access private repositories"
default = ""
}
variable "github_webhook_events" {
type = "list"
description = "A list of events which should trigger the webhook. See a list of [available events](https://developer.github.com/v3/activity/events/types/)"
default = ["push"]
}
variable "repo_owner" {
type = "string"
description = "GitHub Organization or Username"
default = ""
}
variable "repo_name" {
type = "string"
description = "GitHub repository name of the application to be built and deployed to ECS"
default = ""
}
variable "branch" {
type = "string"
description = "Branch of the GitHub repository, e.g. master"
default = ""
}
variable "badge_enabled" {
type = "string"
default = "false"
description = "Generates a publicly-accessible URL for the projects build badge. Available as badge_url attribute when enabled"
}
variable "build_image" {
default = "aws/codebuild/docker:17.09.0"
description = "Docker image for build environment, _e.g._ `aws/codebuild/docker:docker:17.09.0`"
}
variable "build_timeout" {
type = "string"
default = "60"
description = "How long in minutes, from 5 to 480 (8 hours), for AWS CodeBuild to wait until timing out any related build that does not get marked as completed"
}
variable "buildspec" {
default = ""
description = "Declaration to use for building the project. [For more info](http://docs.aws.amazon.com/codebuild/latest/userguide/build-spec-ref.html)"
}
variable "autoscaling_enabled" {
type = "string"
description = "A boolean to enable/disable Autoscaling policy for ECS Service"
default = "false"
}
variable "autoscaling_dimension" {
type = "string"
description = "Dimension to autoscale on (valid options: cpu, memory)"
default = "memory"
}
variable "autoscaling_min_capacity" {
type = "string"
description = "Minimum number of running instances of a Service"
default = "1"
}
variable "autoscaling_max_capacity" {
type = "string"
description = "Maximum number of running instances of a Service"
default = "2"
}
variable "autoscaling_scale_up_adjustment" {
type = "string"
description = "Scaling adjustment to make during scale up event"
default = "1"
}
variable "autoscaling_scale_up_cooldown" {
type = "string"
description = "Period (in seconds) to wait between scale up events"
default = "60"
}
variable "autoscaling_scale_down_adjustment" {
type = "string"
description = "Scaling adjustment to make during scale down event"
default = "-1"
}
variable "autoscaling_scale_down_cooldown" {
type = "string"
description = "Period (in seconds) to wait between scale down events"
default = "300"
}
# https://www.terraform.io/docs/configuration/variables.html
# It is recommended you avoid using boolean values and use explicit strings
variable "poll_source_changes" {
type = "string"
default = "false"
description = "Periodically check the location of your source content and run the pipeline if changes are detected"
}
variable "webhook_enabled" {
description = "Set to false to prevent the module from creating any webhook resources"
default = "true"
}
variable "webhook_target_action" {
description = "The name of the action in a pipeline you want to connect to the webhook. The action must be from the source (first) stage of the pipeline"
default = "Source"
}
variable "webhook_authentication" {
description = "The type of authentication to use. One of IP, GITHUB_HMAC, or UNAUTHENTICATED"
default = "GITHUB_HMAC"
}
variable "webhook_filter_json_path" {
description = "The JSON path to filter on"
default = "$.ref"
}
variable "webhook_filter_match_equals" {
description = "The value to match on (e.g. refs/heads/{Branch})"
default = "refs/heads/{Branch}"
}
variable "alb_ingress_unauthenticated_listener_arns" {
type = "list"
default = []
description = "A list of unauthenticated ALB listener ARNs to attach ALB listener rules to"
}
variable "alb_ingress_unauthenticated_listener_arns_count" {
type = "string"
default = "0"
description = "The number of unauthenticated ARNs in `alb_ingress_unauthenticated_listener_arns`. This is necessary to work around a limitation in Terraform where counts cannot be computed"
}
variable "alb_ingress_authenticated_listener_arns" {
type = "list"
default = []
description = "A list of authenticated ALB listener ARNs to attach ALB listener rules to"
}
variable "alb_ingress_authenticated_listener_arns_count" {
type = "string"
default = "0"
description = "The number of authenticated ARNs in `alb_ingress_authenticated_listener_arns`. This is necessary to work around a limitation in Terraform where counts cannot be computed"
}
variable "authentication_type" {
type = "string"
default = ""
description = "Authentication type. Supported values are `COGNITO` and `OIDC`"
}
variable "authentication_cognito_user_pool_arn" {
type = "string"
description = "Cognito User Pool ARN"
default = ""
}
variable "authentication_cognito_user_pool_client_id" {
type = "string"
description = "Cognito User Pool Client ID"
default = ""
}
variable "authentication_cognito_user_pool_domain" {
type = "string"
description = "Cognito User Pool Domain. The User Pool Domain should be set to the domain prefix (`xxx`) instead of full domain (https://xxx.auth.us-west-2.amazoncognito.com)"
default = ""
}
variable "authentication_oidc_client_id" {
type = "string"
description = "OIDC Client ID"
default = ""
}
variable "authentication_oidc_client_secret" {
type = "string"
description = "OIDC Client Secret"
default = ""
}
variable "authentication_oidc_issuer" {
type = "string"
description = "OIDC Issuer"
default = ""
}
variable "authentication_oidc_authorization_endpoint" {
type = "string"
description = "OIDC Authorization Endpoint"
default = ""
}
variable "authentication_oidc_token_endpoint" {
type = "string"
description = "OIDC Token Endpoint"
default = ""
}
variable "authentication_oidc_user_info_endpoint" {
type = "string"
description = "OIDC User Info Endpoint"
default = ""
}
variable "alb_http_listener_arn" {
type = "string"
description = "The ALB Production Listener ARN"
}
variable "alb_ssl_listener_arn" {
type = "string"
description = "The ALB SSL Listener ARN"
default = ""
}
variable "alb_test_listener_arn" {
type = "string"
description = "The ALB Test Listener ARN"
}
variable "alb_ingress_prod_listener_arns_count" {
type = "string"
default = "0"
description = "The number of production ingress listeners for Blue Green, usually http/s"
}
variable "blue_termination_wait_time_in_minutes" {
type = "string"
default = "60"
description = "The number of minutes to wait after a successful deployment before terminating the old instances."
}
variable "ssl_enabled" {
type = "string"
default = "false"
description = "Is SSL enabeled by default"
}