-
Notifications
You must be signed in to change notification settings - Fork 8
/
Copy pathvariables.tf
421 lines (352 loc) · 11.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
variable "namespace" {
type = string
description = "Namespace (e.g. `cp` or `cloudposse`)"
default = "cp"
}
variable "stage" {
type = string
description = "Stage (e.g. `prod`, `dev`, `staging`)"
default = "prod"
}
variable "name" {
type = string
default = "traefik"
description = "Solution name, e.g. 'app' or 'jenkins'"
}
variable "delimiter" {
type = string
default = "-"
description = "Delimiter to be used between `namespace`, `name`, `stage` and `attributes`"
}
variable "attributes" {
type = list(string)
default = []
description = "Additional attributes, e.g. `1`"
}
variable "tags" {
type = map(string)
default = {}
description = "Additional tags (e.g. `map(`BusinessUnit`,`XYZ`)"
}
variable "vpc_id" {
type = string
description = "Id of VPC in which Traefik service should be deployed"
}
variable "alb_security_group_id" {
type = string
description = "ALB security group id. Traefik container will accept traefik from port 80"
}
variable "alb_target_group_arn" {
type = string
description = "ALB Target Group ARN"
}
variable "subnet_ids" {
description = "Subnet IDs"
type = list(string)
}
variable "ecs_cluster_name" {
type = string
description = "ECS cluster name"
}
variable "ecs_cluster_arn" {
type = string
description = "ECS cluster ARN"
}
variable "ecs_cluster_region" {
type = string
default = "us-east-1"
description = "ECS cluster region"
}
variable "security_group_ids" {
description = "Additional security group IDs to allow in Service `network_configuration`"
type = list(string)
default = []
}
variable "launch_type" {
type = string
description = "The launch type on which to run your service. Valid values are `EC2` and `FARGATE`"
default = "FARGATE"
}
variable "assign_public_ip" {
type = bool
default = false
description = "Assign a public IP address to the ENI (Fargate launch type only). Valid values are true or false. Default false."
}
variable "container_name" {
type = string
default = "traefik"
description = "The name of the container in task definition to associate with the load balancer"
}
variable "task_image" {
type = string
default = "library/traefik:1.7"
description = "Traefik image"
}
variable "task_cpu" {
type = number
description = "The vCPU setting to control cpu limits of traefik 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 "task_memory" {
type = number
description = "The amount of RAM to allow traefik 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 "task_memory_reservation" {
type = number
description = "The amount of RAM (Soft Limit) to allow traefik container to use in MB. This value must be less than container_memory if set"
default = 128
}
variable "log_level" {
type = string
default = "INFO"
description = "Traefk log level. See https://docs.traefik.io/configuration/logs/"
}
variable "log_format" {
type = string
default = "common"
description = "Traefk log format. See https://docs.traefik.io/configuration/logs/"
}
variable "logs_retention" {
type = number
default = 30
description = "Defines retention period in days for Traefik logs in Cloudwatch"
}
variable "logs_region" {
type = string
default = ""
description = "AWS region for storing Cloudwatch logs from traefik container. Defaults to the same as ECS Cluster region."
}
variable "http_port" {
type = number
default = 80
description = "Port at which Traefik will accept traffic from ALB"
}
variable "api_port" {
type = number
default = 8080
description = "Port at which Traefik will expose the API and Dashboard"
}
variable "dashboard_enabled" {
type = bool
default = false
description = "Defines whether traefik dashboard is enabled"
}
variable "dashboard_host" {
type = string
default = "dashboard.example.com"
description = "Traefik dashboard host at which API should be exposed"
}
variable "dashboard_basic_auth_enabled" {
type = bool
default = true
description = "Defines whther basic auth is enabled for Traefik dashboard or not"
}
variable "dashboard_basic_auth_user" {
type = string
default = "admin"
description = "Basic auth username for Traefik dashboard"
}
variable "dashboard_basic_auth_password" {
type = string
default = ""
description = "Basic auth password for Traefik dashboard. If left empty, a random one will be generated."
}
variable "desired_count" {
type = number
description = "The number of instances of the task definition to place and keep running"
default = 1
}
variable "deployment_controller_type" {
type = string
description = "Type of deployment controller. Valid values: `CODE_DEPLOY`, `ECS`."
default = "ECS"
}
variable "deployment_maximum_percent" {
type = number
description = "The upper limit of the number of tasks (as a percentage of `desired_count`) that can be running in a service during a deployment"
default = 200
}
variable "deployment_minimum_healthy_percent" {
type = number
description = "The lower limit (as a percentage of `desired_count`) of the number of tasks that must remain running and healthy in a service during a deployment"
default = 100
}
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 = 10
}
variable "mount_points" {
type = list(object({
containerPath = string
sourceVolume = string
}))
description = "Container mount points. This is a list of maps, where each map should contain a `containerPath` and `sourceVolume`"
default = null
}
variable "volumes" {
type = list(object({
host_path = string
name = string
docker_volume_configuration = list(object({
autoprovision = bool
driver = string
driver_opts = map(string)
labels = map(string)
scope = string
}))
}))
description = "Task volume definitions as list of configuration objects"
default = []
}
variable "ignore_changes_task_definition" {
type = bool
description = "Whether to ignore changes in container definition and task definition in the ECS service"
default = true
}
variable "autoscaling_enabled" {
type = bool
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 = number
description = "Minimum number of running instances of a Service"
default = 1
}
variable "autoscaling_max_capacity" {
type = number
description = "Maximum number of running instances of a Service"
default = 2
}
variable "autoscaling_scale_up_adjustment" {
type = number
description = "Scaling adjustment to make during scale up event"
default = 1
}
variable "autoscaling_scale_up_cooldown" {
type = number
description = "Period (in seconds) to wait between scale up events"
default = 60
}
variable "autoscaling_scale_down_adjustment" {
type = number
description = "Scaling adjustment to make during scale down event"
default = -1
}
variable "autoscaling_scale_down_cooldown" {
type = number
description = "Period (in seconds) to wait between scale down events"
default = 300
}
variable "ecs_alarms_enabled" {
type = bool
description = "A boolean to enable/disable CloudWatch Alarms for ECS Service metrics"
default = false
}
variable "ecs_alarms_cpu_utilization_high_threshold" {
type = number
description = "The maximum percentage of CPU utilization average"
default = 80
}
variable "ecs_alarms_cpu_utilization_high_evaluation_periods" {
type = number
description = "Number of periods to evaluate for the alarm"
default = 1
}
variable "ecs_alarms_cpu_utilization_high_period" {
type = number
description = "Duration in seconds to evaluate for the alarm"
default = 300
}
variable "ecs_alarms_cpu_utilization_high_alarm_actions" {
type = list(string)
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(string)
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 = number
description = "The minimum percentage of CPU utilization average"
default = 20
}
variable "ecs_alarms_cpu_utilization_low_evaluation_periods" {
type = number
description = "Number of periods to evaluate for the alarm"
default = 1
}
variable "ecs_alarms_cpu_utilization_low_period" {
type = number
description = "Duration in seconds to evaluate for the alarm"
default = 300
}
variable "ecs_alarms_cpu_utilization_low_alarm_actions" {
type = list(string)
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(string)
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 = number
description = "The maximum percentage of Memory utilization average"
default = 80
}
variable "ecs_alarms_memory_utilization_high_evaluation_periods" {
type = number
description = "Number of periods to evaluate for the alarm"
default = 1
}
variable "ecs_alarms_memory_utilization_high_period" {
type = number
description = "Duration in seconds to evaluate for the alarm"
default = 300
}
variable "ecs_alarms_memory_utilization_high_alarm_actions" {
type = list(string)
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(string)
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 = number
description = "The minimum percentage of Memory utilization average"
default = 20
}
variable "ecs_alarms_memory_utilization_low_evaluation_periods" {
type = number
description = "Number of periods to evaluate for the alarm"
default = 1
}
variable "ecs_alarms_memory_utilization_low_period" {
type = number
description = "Duration in seconds to evaluate for the alarm"
default = 300
}
variable "ecs_alarms_memory_utilization_low_alarm_actions" {
type = list(string)
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(string)
description = "A list of ARNs (i.e. SNS Topic ARN) to notify on Memory Utilization Low OK action"
default = []
}