-
Notifications
You must be signed in to change notification settings - Fork 2
/
Copy pathvariables.tf
281 lines (239 loc) · 9.11 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
variable "app_image_repository" {
type = string
description = "Container registry repository url"
default = ""
}
variable "app_image_tag" {
type = string
description = "The default container image to use in container definition"
default = null
}
variable "cloudwatch_event_policy_arns" {
type = string
default = ""
description = "The Amazon Resource Name (ARN) of the IAM role to be used for this target when the rule is triggered."
}
variable "cloudwatch_log_group_enabled" {
type = bool
description = "A boolean to disable cloudwatch log group creation"
default = true
}
variable "container_cpu" {
type = number
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 = 0
}
variable "container_map_environment" {
type = map(string)
description = "The environment variables to pass to the container. This is a map of string: {key: value}. `environment` overrides `map_environment`"
default = null
}
variable "container_memory" {
type = number
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 = null
}
variable "container_memory_reservation" {
type = number
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 = 128
}
variable "container_start_timeout" {
type = number
description = "Time duration (in seconds) to wait before giving up on resolving dependencies for a container"
default = null
}
variable "container_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"
default = null
}
variable "ecs_cluster_arn" {
type = string
description = "The ECS Cluster ARN where ECS Service will be provisioned"
}
variable "healthcheck" {
type = object({
command = list(string)
retries = number
timeout = number
interval = number
startPeriod = number
})
description = "A map containing command (string), timeout, 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 = null
}
variable "is_enabled" {
type = bool
description = "Whether the rule should be enabled."
default = true
}
variable "label_orders" {
type = object({
cloudwatch = optional(list(string)),
ecs = optional(list(string)),
iam = optional(list(string)),
ssm = optional(list(string))
})
default = {}
description = "Overrides the `labels_order` for the different labels to modify ID elements appear in the `id`"
}
variable "launch_type" {
type = string
description = "The launch type on which to run your service. Valid values are `EC2` and `FARGATE`"
default = "EC2"
}
variable "log_driver" {
type = string
description = "The log driver to use for the container. If using Fargate launch type, only supported value is awslogs"
default = "awsfirelens"
}
variable "log_retention_in_days" {
type = number
description = "The number of days to retain logs for the log group"
default = 1
}
variable "log_router_container_cpu" {
type = string
description = "The log router cpu reservation for the ECS task definition"
default = 30
}
variable "log_router_container_memory_reservation" {
type = string
description = "The log router cpu reservation for the ECS task definition"
default = 64
}
variable "log_router_essential" {
type = bool
description = "Determines whether all other containers in a task are stopped, if this container fails or stops for any reason. Due to how Terraform type casts booleans in json it is required to double quote this value"
default = false
}
variable "log_router_image_repository" {
type = string
description = "Container registry repository url"
default = ""
}
variable "log_router_image_tag" {
type = string
description = "The default container image to use in container definition"
default = null
}
variable "log_router_map_environment" {
type = map(string)
description = "The environment variables to pass to the container. This is a map of string: {key: value}. `environment` overrides `map_environment`"
default = null
}
variable "log_router_options" {
type = map(string)
description = "The log router options to use"
default = {
config-file-type = "file",
config-file-value = "/fluent-bit/etc/extra.conf"
}
}
variable "log_router_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"
default = 60
}
variable "log_router_type" {
type = string
description = "The log router type to use"
default = "fluentbit"
}
variable "map_secrets" {
type = map(string)
description = "The secrets variables to pass to the container. This is a map of string: {key: value}. map_secrets overrides secrets"
default = null
}
variable "network_mode" {
type = string
description = "The network mode to use for the task. This is required to be `awsvpc` for `FARGATE` `launch_type` or `null` for `EC2` `launch_type`"
default = null
}
variable "port_gateway" {
type = number
description = "Define the gateway port"
default = 8088
}
variable "port_health" {
type = number
description = "Define the health port"
default = 8090
}
variable "port_mappings" {
type = list(object({
containerPort = number
hostPort = number
protocol = string
}))
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 = []
}
variable "port_metadata" {
type = number
description = "Define the metadata port"
default = 8070
}
variable "port_profiling" {
type = number
description = "Define the profiling port"
default = 8091
}
variable "schedule_expression" {
type = string
default = ""
description = "The scheduling expression. For example, cron(0 20 * * ? *) or rate(5 minutes). At least one of schedule_expression or event_pattern is required. Can only be used on the default event bus."
}
variable "secrets" {
type = list(object({
name = string
valueFrom = string
}))
description = "The secrets to pass to the container. This is a list of maps"
default = []
}
variable "security_groups" {
type = list(string)
description = "The security groups associated with the task or service. If you do not specify a security group, the default security group for the VPC is used."
default = []
}
variable "subnet_ids" {
type = list(string)
description = "A list of subnet IDs to associate with the task or service"
default = []
}
variable "task_count" {
type = number
description = "The number of tasks to create based on the TaskDefinition."
default = null
}
variable "task_cpu" {
type = number
description = "The number of CPU units used by the task. If unspecified, it will default to `container_cpu`. If using `FARGATE` launch type `task_cpu` must match supported memory values (https://docs.aws.amazon.com/AmazonECS/latest/developerguide/task_definition_parameters.html#task_size)"
default = null
}
variable "task_memory" {
type = number
description = "The amount of memory (in MiB) used by the task. If unspecified, it will default to `container_memory`. If using Fargate launch type `task_memory` must match supported cpu value (https://docs.aws.amazon.com/AmazonECS/latest/developerguide/task_definition_parameters.html#task_size)"
default = null
}
variable "task_policy_arns" {
type = list(string)
description = "A list of IAM Policy ARNs to attach to the generated task role."
default = []
}
variable "ulimits" {
type = list(object({
name = string
softLimit = number
hardLimit = number
}))
description = "The ulimits to configure for the container. This is a list of maps. Each map should contain \"name\", \"softLimit\" and \"hardLimit\""
default = []
}
variable "working_directory" {
type = string
description = "The working directory to run commands inside the container"
default = "/app"
}