-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathvariables.tf
438 lines (376 loc) · 12.1 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
variable "access_log_force_destroy" {
description = "Destroy S3 bucket with access logs even if non-empty"
type = bool
default = false
}
variable "ami_id" {
description = "Image for host EC2 instances. If not specified, the latest Amazon image will be used."
type = string
default = null
}
variable "asg_instance_type" {
description = "EC2 instances type"
type = string
default = "t3.micro"
}
variable "asg_health_check_grace_period" {
description = "ASG will wait up to this number of seconds for instance to become healthy"
type = number
default = 300
}
variable "asg_min_size" {
description = "Minimum number of instances in ASG. By default, the number of subnets."
type = number
default = null
}
variable "asg_max_size" {
description = "Maximum number of instances in ASG. By default, it's calculated based on number of tasks and their memory requirements."
type = number
default = null
}
variable "asg_subnets" {
description = "Auto Scaling Group Subnets."
type = list(string)
}
variable "assume_dns" {
description = "If True, create DNS records provided by var.dns_a_records."
type = bool
default = true
}
variable "autoscaling_metric" {
description = "Metric to base autoscaling on. Can be ECSServiceAverageCPUUtilization, ECSServiceAverageMemoryUtilization, ALBRequestCountPerTarget"
type = string
default = "ECSServiceAverageCPUUtilization"
}
variable "autoscaling_target_cpu_usage" {
description = "If autoscaling_metric is ECSServiceAverageCPUUtilization, how much CPU an ECS service aims to use."
type = number
default = 80
}
variable "autoscaling_target" {
description = "Target value for autoscaling_metric."
type = number
default = null
}
variable "cloudwatch_agent_image" {
description = "Cloudwatch agent image"
type = string
default = "public.ecr.aws/cloudwatch-agent/cloudwatch-agent:latest"
}
variable "cloudwatch_log_group" {
description = "CloudWatch log group to create and use. Default: /ecs/{var.environment}/{var.service_name}"
type = string
default = null
}
variable "cloudwatch_log_group_retention" {
description = "Number of days you want to retain log events in the log group."
default = 90
type = number
}
variable "enable_cloudwatch_logs" {
description = "Enable Cloudwatch logs. If enabled, log driver will be awslogs."
type = bool
default = false
}
variable "enable_container_insights" {
description = "Enable container insights feature on ECS cluster."
type = bool
default = false
}
variable "healthcheck_interval" {
description = "Number of seconds between checks"
type = number
default = 10
}
variable "healthcheck_timeout" {
description = "Healthcheck timeout"
type = number
default = 5
}
variable "healthcheck_path" {
description = "Path on the webserver that the elb will check to determine whether the instance is healthy or not."
type = string
default = "/index.html"
}
variable "idle_timeout" {
description = "The time in seconds that the connection is allowed to be idle."
type = number
default = 60
}
variable "healthcheck_response_code_matcher" {
description = "Range of http return codes that can match"
type = string
default = "200-299"
}
variable "container_command" {
description = "If specified, use this list of strings as a docker command."
type = list(string)
default = null
}
variable "container_healthcheck_command" {
description = "A shell command that a container runs to check if it's healthy. Exit code 0 means healthy, non-zero - unhealthy."
type = string
default = "curl -f http://localhost/ || exit 1"
}
variable "container_cpu" {
description = "Number of CPU units that a container is going to use."
type = number
default = 200
}
variable "container_memory" {
description = "Amount of RAM in megabytes the container is going to use."
type = number
default = 128
}
variable "container_port" {
description = "TCP port that a container serves client requests on."
type = number
default = 8080
}
variable "dns_names" {
description = "List of hostnames the module will create in var.zone_id."
type = list(string)
}
variable "docker_image" {
description = "A container image that will run the service."
type = string
}
variable "dockerSecurityOptions" {
description = "A list of strings to provide custom configuration for multiple security systems. Supported prefixes are 'label:', 'apparmor:', and 'credentialspec:' or you can specify 'no-new-privileges'"
type = list(string)
default = null
}
variable "environment" {
description = "Name of environment."
type = string
default = "development"
}
variable "extra_files" {
description = "Additional files to create on a host EC2 instance."
type = list(
object(
{
content = string
path = string
permissions = string
}
)
)
default = []
}
variable "internet_gateway_id" {
description = "Internet gateway id. Usually created by 'infrahouse/service-network/aws'"
type = string
default = null
}
variable "lb_type" {
description = "Load balancer type. ALB or NLB"
type = string
default = "alb"
}
variable "load_balancer_subnets" {
description = "Load Balancer Subnets."
type = list(string)
}
variable "managed_draining" {
description = "Enables or disables a graceful shutdown of instances without disturbing workloads."
type = bool
default = true
}
variable "managed_termination_protection" {
description = "Enables or disables container-aware termination of instances in the auto scaling group when scale-in happens."
type = bool
default = true
}
variable "on_demand_base_capacity" {
description = "If specified, the ASG will request spot instances and this will be the minimal number of on-demand instances."
type = number
default = null
}
variable "root_volume_size" {
description = "Root volume size in EC2 instance in Gigabytes"
type = number
default = 30
}
variable "service_name" {
description = "Service name"
type = string
}
variable "service_health_check_grace_period_seconds" {
description = "Seconds to ignore failing load balancer health checks on newly instantiated tasks to prevent premature shutdown, up to 2147483647."
type = number
default = null
}
variable "ssh_key_name" {
description = "ssh key name installed in ECS host instances."
type = string
default = null
}
variable "ssh_cidr_block" {
description = "CIDR range that is allowed to SSH into the backend instances"
type = string
default = null
}
variable "tags" {
description = "Tags to apply to resources creatded by the module."
type = map(string)
default = {}
}
variable "task_secrets" {
description = "Secrets to pass to a container. A `name` will be the environment variable. valueFrom is a secret ARN."
type = list(
object(
{
name : string
valueFrom : string
}
)
)
sensitive = true
default = []
}
variable "task_desired_count" {
description = "Number of containers the ECS service will maintain."
type = number
default = 1
}
variable "task_environment_variables" {
description = "Environment variables passed down to a task."
type = list(
object(
{
name : string
value : string
}
)
)
sensitive = true
default = []
}
variable "task_ipc_mode" {
description = "The IPC resource namespace to use for the containers in the task. See https://docs.aws.amazon.com/AmazonECS/latest/APIReference/API_TaskDefinition.html"
type = string
default = null
}
variable "task_max_count" {
description = "Highest number of tasks to run"
type = number
default = 10
}
variable "task_min_count" {
description = "Lowest number of tasks to run"
type = number
default = 1
}
variable "task_role_arn" {
description = "Task Role ARN. The role will be assumed by a container."
type = string
default = null
}
variable "task_efs_volumes" {
description = "Map name->{file_system_id, container_path} of EFS volumes defined in task and available for containers to mount."
type = map(
object(
{
file_system_id : string
container_path : string
}
)
)
default = {}
}
variable "task_local_volumes" {
description = "Map name->{host_path, container_path} of local volumes defined in task and available for containers to mount."
type = map(
object(
{
host_path : string
container_path : string
}
)
)
default = {}
}
variable "upstream_module" {
description = "Module that called this module."
type = string
default = null
}
variable "users" {
description = "A list of maps with user definitions according to the cloud-init format"
default = null
type = any
# Check https://cloudinit.readthedocs.io/en/latest/reference/examples.html#including-users-and-groups
# for fields description and examples.
# type = list(
# object(
# {
# name : string
# expiredate : optional(string)
# gecos : optional(string)
# homedir : optional(string)
# primary_group : optional(string)
# groups : optional(string) # Comma separated list of strings e.g. groups: users, admin
# selinux_user : optional(string)
# lock_passwd : optional(bool)
# inactive : optional(number)
# passwd : optional(string)
# no_create_home : optional(bool)
# no_user_group : optional(bool)
# no_log_init : optional(bool)
# ssh_import_id : optional(list(string))
# ssh_authorized_keys : optional(list(string))
# sudo : any # Can be either false or a list of strings e.g. sudo = ["ALL=(ALL) NOPASSWD:ALL"]
# system : optional(bool)
# snapuser : optional(string)
# }
# )
# )
}
variable "vanta_owner" {
description = "The email address of the instance's owner, and it should be set to the email address of a user in Vanta. An owner will not be assigned if there is no user in Vanta with the email specified."
type = string
default = null
}
variable "vanta_production_environments" {
description = "Environment names to consider production grade in Vanta."
type = list(string)
default = [
"production",
"prod"
]
}
variable "vanta_description" {
description = "This tag allows administrators to set a description, for instance, or add any other descriptive information."
type = string
default = null
}
variable "vanta_contains_user_data" {
description = "his tag allows administrators to define whether or not a resource contains user data (true) or if they do not contain user data (false)."
type = bool
default = false
}
variable "vanta_contains_ephi" {
description = "This tag allows administrators to define whether or not a resource contains electronically Protected Health Information (ePHI). It can be set to either (true) or if they do not have ephi data (false)."
type = bool
default = false
}
variable "vanta_user_data_stored" {
description = "This tag allows administrators to describe the type of user data the instance contains."
type = string
default = null
}
variable "vanta_no_alert" {
description = "Administrators can add this tag to mark a resource as out of scope for their audit. If this tag is added, the administrator will need to set a reason for why it's not relevant to their audit."
type = string
default = null
}
variable "zone_id" {
description = "Zone where DNS records will be created for the service and certificate validation."
type = string
}
variable "execution_task_role_policy_arn" {
description = "Extra policy for execution task role"
type = string
default = ""
}