-
Notifications
You must be signed in to change notification settings - Fork 80
/
variables.tf
374 lines (312 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
variable "name_prefix" {
description = "A prefix used for naming resources."
type = string
}
variable "sg_name_prefix" {
description = "A prefix used for Security group name."
type = string
default = ""
}
variable "container_name" {
description = "Optional name for the container to be used instead of name_prefix."
default = ""
type = string
}
variable "vpc_id" {
description = "The VPC ID."
type = string
}
variable "private_subnet_ids" {
description = "A list of private subnets inside the VPC"
type = list(string)
}
variable "cluster_id" {
description = "The Amazon Resource Name (ARN) that identifies the cluster."
type = string
}
variable "platform_version" {
description = "The platform version on which to run your service. Only applicable for launch_type set to FARGATE."
default = "LATEST"
type = string
}
variable "task_container_image" {
description = "The image used to start a container."
type = string
default = "marcincuber/2048-game:latest"
}
variable "desired_count" {
description = "The number of instances of the task definitions to place and keep running."
default = 1
type = number
}
variable "task_container_assign_public_ip" {
description = "Assigned public IP to the container."
default = false
type = bool
}
variable "task_container_port" {
description = "The port number on the container that is bound to the user-specified or automatically assigned host port"
type = number
default = 80
}
variable "task_host_port" {
description = "The port number on the container instance to reserve for your container."
type = number
default = 80
}
variable "task_container_protocol" {
description = "Protocol that the container exposes."
default = "HTTP"
type = string
}
variable "task_definition_cpu" {
description = "Amount of CPU to reserve for the task."
default = 256
type = number
}
variable "task_definition_memory" {
description = "The soft limit (in MiB) of memory to reserve for the task."
default = 512
type = number
}
variable "task_definition_ephemeral_storage" {
description = "The total amount, in GiB, of ephemeral storage to set for the task."
default = 0
type = number
}
variable "task_container_command" {
description = "The command that is passed to the container."
default = []
type = list(string)
}
variable "task_container_entrypoint" {
description = "The entrypoint that is passed to the container."
default = []
type = list(string)
}
variable "task_container_environment" {
description = "The environment variables to pass to a container."
default = {}
type = map(string)
}
variable "task_container_environment_files" {
description = "The environment variable files (s3 object arns) to pass to a container. Files must use .env file extension."
default = []
type = list(string)
}
variable "task_container_secrets" {
description = "The secrets variables to pass to a container."
default = null
type = list(map(string))
}
variable "log_retention_in_days" {
description = "Number of days the logs will be retained in CloudWatch."
default = 30
type = number
}
variable "health_check" {
description = "A health block containing health check settings for the target group. Overrides the defaults."
type = map(string)
default = {}
}
variable "health_check_grace_period_seconds" {
default = 300
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."
type = number
}
variable "tags" {
description = "A map of tags (key-value pairs) passed to resources."
type = map(string)
default = {}
}
variable "deployment_minimum_healthy_percent" {
default = 50
description = "The lower limit of the number of running tasks that must remain running and healthy in a service during a deployment"
type = number
}
variable "deployment_maximum_percent" {
default = 200
description = "The upper limit of the number of running tasks that can be running in a service during a deployment"
type = number
}
variable "deployment_controller_type" {
default = "ECS"
type = string
description = "Type of deployment controller. Valid values: CODE_DEPLOY, ECS, EXTERNAL. Default: ECS."
}
variable "enable_deployment_circuit_breaker" {
default = "false"
type = bool
description = "Whether to enable the deployment circuit breaker logic for the service."
}
variable "enable_deployment_circuit_breaker_rollback" {
default = "false"
type = bool
description = "Whether to enable Amazon ECS to roll back the service if a service deployment fails. If rollback is enabled, when a service deployment fails, the service is rolled back to the last deployment that completed successfully."
}
# https://docs.aws.amazon.com/AmazonECS/latest/developerguide/private-auth.html
variable "repository_credentials" {
default = ""
description = "name or ARN of a secrets manager secret (arn:aws:secretsmanager:region:aws_account_id:secret:secret_name)"
type = string
}
variable "repository_credentials_kms_key" {
default = "alias/aws/secretsmanager"
description = "key id, key ARN, alias name or alias ARN of the key that encrypted the repository credentials"
type = string
}
variable "create_repository_credentials_iam_policy" {
default = false
description = "Set to true if you are specifying `repository_credentials` variable, it will attach IAM policy with necessary permissions to task role."
type = bool
}
variable "service_registry_arn" {
default = ""
description = "ARN of aws_service_discovery_service resource"
type = string
}
variable "propagate_tags" {
type = string
description = "Specifies whether to propagate the tags from the task definition or the service to the tasks. The valid values are SERVICE and TASK_DEFINITION."
default = "TASK_DEFINITION"
}
variable "target_groups" {
type = any
default = []
description = "The name of the target groups to associate with ecs service"
}
variable "load_balanced" {
type = bool
default = true
description = "Whether the task should be loadbalanced."
}
variable "logs_kms_key" {
type = string
description = "The KMS key ARN to use to encrypt container logs."
default = ""
}
variable "capacity_provider_strategy" {
type = list(any)
description = "(Optional) The capacity_provider_strategy configuration block. This is a list of maps, where each map should contain \"capacity_provider \", \"weight\" and \"base\""
default = []
}
variable "placement_constraints" {
type = list(any)
description = "(Optional) A set of placement constraints rules that are taken into consideration during task placement. Maximum number of placement_constraints is 10. This is a list of maps, where each map should contain \"type\" and \"expression\""
default = []
}
variable "proxy_configuration" {
type = list(any)
description = "(Optional) The proxy configuration details for the App Mesh proxy. This is a list of maps, where each map should contain \"container_name\", \"properties\" and \"type\""
default = []
}
variable "volume" {
description = "(Optional) A set of volume blocks that containers in your task may use. This is a list of maps, where each map should contain \"name\", \"host_path\", \"docker_volume_configuration\" and \"efs_volume_configuration\". Full set of options can be found at https://www.terraform.io/docs/providers/aws/r/ecs_task_definition.html"
default = []
type = list(any)
}
variable "task_health_command" {
type = list(string)
description = "A string array representing the command that the container runs to determine if it is healthy."
default = null
}
variable "task_health_check" {
type = map(number)
description = "An optional healthcheck definition for the task"
default = null
}
variable "task_container_cpu" {
description = "Amount of CPU to reserve for the container."
default = null
type = number
}
variable "task_container_memory" {
description = "The hard limit (in MiB) of memory for the container."
default = null
type = number
}
variable "task_container_memory_reservation" {
description = "The soft limit (in MiB) of memory to reserve for the container."
default = null
type = number
}
variable "task_container_working_directory" {
description = "The working directory to run commands inside the container."
default = ""
type = string
}
variable "task_start_timeout" {
type = number
description = "Time duration (in seconds) to wait before giving up on resolving dependencies for a container. If this parameter is not specified, the default value of 3 minutes is used (fargate)."
default = null
}
variable "task_stop_timeout" {
type = number
description = "Time duration (in seconds) to wait before the container is forcefully killed if it doesn't exit normally on its own. The max stop timeout value is 120 seconds and if the parameter is not specified, the default value of 30 seconds is used."
default = null
}
variable "task_mount_points" {
description = "The mount points for data volumes in your container. Each object inside the list requires \"sourceVolume\", \"containerPath\" and \"readOnly\". For more information see https://docs.aws.amazon.com/AmazonECS/latest/developerguide/task_definition_parameters.html "
type = list(object({ sourceVolume = string, containerPath = string, readOnly = bool }))
default = null
}
variable "task_pseudo_terminal" {
type = bool
description = "Allocate TTY in the container"
default = null
}
variable "force_new_deployment" {
type = bool
description = "Enable to force a new task deployment of the service. This can be used to update tasks to use a newer Docker image with same image/tag combination (e.g. myimage:latest), roll Fargate tasks onto a newer platform version."
default = false
}
variable "wait_for_steady_state" {
type = bool
description = "If true, Terraform will wait for the service to reach a steady state (like aws ecs wait services-stable) before continuing."
default = false
}
variable "enable_execute_command" {
type = bool
description = "Specifies whether to enable Amazon ECS Exec for the tasks within the service."
default = true
}
variable "enable_ecs_managed_tags" {
type = bool
description = "Specifies whether to enable Amazon ECS managed tags for the tasks within the service"
default = true
}
variable "operating_system_family" {
description = "The operating system family for the task."
default = "LINUX"
type = string
}
variable "cpu_architecture" {
description = "cpu architecture for the task"
default = "X86_64"
type = string
}
variable "readonlyRootFilesystem" {
default = false
description = "When this parameter is true, the container is given read-only access to its root file system"
type = bool
}
variable "deny_egress_to_anywhere" {
default = false
description = "When this parameter is true, no default egress rule will be created"
type = bool
}
variable "container_definitions" {
description = "A string containing json encoded array of container definitions for Task Definition"
type = string
default = null
}
variable "enable_logs" {
description = "Turn cloudwatch logging optional"
type = bool
default = true
}
variable "log_groups_arn" {
description = "List of CloudWatch Group ARNs to use when enable_logs is set to false"
type = list(string)
default = []
}