-
Notifications
You must be signed in to change notification settings - Fork 13
/
Copy pathvariables.tf
330 lines (268 loc) · 8.94 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
variable "region" {
type = string
description = "AWS region in which ECS cluster is located (default is 'us-east-1')"
default = "us-east-1"
}
variable "env" {
type = string
description = "Environment of an application"
}
variable "vpc_id" {
type = string
description = "ID of VPC in which ECS cluster is located"
}
variable "ecs_cluster_arn" {
type = string
description = "ARN of ECS cluster in which the service will be deployed"
}
variable "ecs_security_group_id" {
type = string
description = "Security group ID of ECS cluster in which the service will be deployed"
}
variable "ecs_desired_count" {
type = string
description = "Desired number of containers in the task (default 1)"
default = 1
}
variable "ecs_deployment_maximum_percent" {
default = "200"
description = "Upper limit in percentage of tasks that can be running during a deployment (default 200)"
}
variable "ecs_deployment_minimum_healthy_percent" {
default = "100"
description = "Lower limit in percentage of tasks that must remain healthy during a deployment (default 100)"
}
variable "deployment_controller_type" {
description = "Type of deployment controller. Valid values: CODE_DEPLOY, ECS. Default: ECS."
default = "ECS"
}
variable "ecs_health_check_grace_period" {
default = "0"
description = "Seconds to ignore failing load balancer health checks on newly instantiated tasks to prevent premature shutdown, up to 1800. (default 0)"
}
variable "docker_command" {
description = "String to override CMD in Docker container (default \"\")"
default = ""
}
variable "docker_image" {
type = string
description = "Docker image to use for task"
}
variable "docker_memory" {
description = "Hard limit on memory use for task container (default 256)"
default = 256
}
variable "docker_memory_reservation" {
description = "Soft limit on memory use for task container (default 128)"
default = 128
}
variable "docker_port_mappings" {
description = "List of port mapping maps of format { \"containerPort\" = integer, [ \"hostPort\" = integer, \"protocol\" = \"tcp or udp\" ] }"
default = []
}
variable "docker_environment" {
description = "List of environment maps of format { \"name\" = \"var_name\", \"value\" = \"var_value\" }"
default = []
}
variable "network_mode" {
description = "Docker network mode for task (default \"bridge\")"
default = "bridge"
}
variable "req_compatibilities" {
description = "Launch type required by the task. Either EC2 or FARGATE"
default = "[FARGATE]"
}
variable "cpu" {
description = "Number of cpu units used by the task. Required for FARGATE type"
default = null
}
variable "memory" {
description = "Amount (in MiB) of memory used by the task. Required for FARGATE type"
default = null
}
variable "service_identifier" {
description = "Unique identifier for this pganalyze service (used in log prefix, service name etc.)"
}
variable "task_identifier" {
description = "Unique identifier for this pganalyze task (used in log prefix, service name etc.)"
default = "task"
}
variable "extra_task_policy_arns" {
type = list(string)
description = "List of ARNs of IAM policies to be attached to the ECS task role (in addition to the default policy, so cannot be more than 9 ARNs)"
default = []
}
variable "acm_cert_domain" {
type = string
description = "Domain name of ACM-managed certificate"
default = null
}
variable "alb_enable_https" {
description = "Enable HTTPS listener in ALB (default true)"
default = "true"
}
variable "alb_enable_http" {
description = "Enable HTTP listener in ALB (default false)"
default = "false"
}
variable "alb_sg_cidr" {
description = "List of CIDR blocks for ALB SG, default [\"0.0.0.0/0\"]"
default = ["0.0.0.0/0"]
}
variable "alb_sg_cidr_egress" {
description = "List of CIDR blocks for ALB SG, default [\"0.0.0.0/0\"]"
default = ["0.0.0.0/0"]
}
variable "alb_internal" {
description = "Configure ALB as internal-only (default false)"
default = "false"
}
variable "alb_subnet_ids" {
type = list(string)
description = "VPC subnet IDs in which to create the ALB (unnecessary if neither alb_enable_https or alb_enable_http are true)"
default = []
}
variable "target_type" {
description = "Type of target that you must specify when registering targets with this target group"
default = "instance"
}
variable "app_port" {
description = "Numeric port on which application listens (unnecessary if neither alb_enable_https or alb_enable_http are true)"
}
variable "host_port" {
description = "Numeric port on which you want to map it to on the host"
default = 0
}
variable "ecs_placement_strategy_type" {
description = "Placement strategy to use when distributing tasks (default spread)"
default = "spread"
}
variable "ecs_placement_strategy_field" {
description = "Container metadata field to use when distributing tasks (default instanceId)"
default = "instanceId"
}
variable "ecs_log_retention" {
description = "Number of days of ECS task logs to retain (default 3)"
default = 3
}
variable "lb_log_enabled" {
description = "Enables/Disables logging to designated S3 bucket. S3 bucket name (lb_bucket_name) is still required. (default is true)"
default = true
}
variable "lb_bucket_name" {
description = "Full name for S3 bucket."
}
variable "lb_prefix_override" {
default = null
}
variable "lb_log_prefix" {
description = "Prefix for S3 bucket. (default is log/elb)."
default = "logs/elb"
}
variable "alb_healthcheck_interval" {
description = "Time in seconds between ALB health checks (default 30)"
default = 30
}
variable "alb_healthcheck_path" {
description = "URI path for ALB health checks (default /)"
default = "/"
}
variable "alb_healthcheck_port" {
description = "Port for ALB to use when connecting health checks (default same as application traffic)"
default = "traffic-port"
}
variable "alb_healthcheck_protocol" {
description = "Protocol for ALB to use when connecting health checks (default HTTP)"
default = "HTTP"
}
variable "alb_healthcheck_timeout" {
description = "Timeout in seconds for ALB to use when connecting health checks (default 5)"
default = 5
}
variable "alb_healthcheck_healthy_threshold" {
description = "Number of consecutive successful health checks before marking service as healthy (default 5)"
default = 5
}
variable "alb_healthcheck_unhealthy_threshold" {
description = "Number of consecutive failed health checks before marking service as unhealthy (default 2)"
default = 5
}
variable "alb_healthcheck_matcher" {
description = "HTTP response codes to accept as healthy (default 200)"
default = "200"
}
variable "alb_stickiness_enabled" {
description = "Enable ALB session stickiness (default false)"
default = "false"
}
variable "alb_cookie_duration" {
description = "Duration of ALB session stickiness cookie in seconds (default 86400)"
default = "86400"
}
variable "alb_deregistration_delay" {
description = "The amount of time in seconds to wait before deregistering a target from a target group."
default = "300"
}
variable "network_config" {
description = "Applicable when networkmode is fargate"
type = list(object({
security_groups = optional(list(string))
subnets = optional(list(string))
assign_public_ip = optional(bool)
}))
default = []
}
variable "task_volume" {
description = "optional volume block in task definition. Do not pass any value for FARGATE launch type"
type = list(object({
name = string
host_path = optional(string)
}))
default = []
}
variable "launch_type" {
description = "Launch type on which to run the service. Default is EC2"
default = "FARGATE"
}
variable "placement_strategy" {
type = list(object({
type = string
field = optional(string)
}))
}
variable "docker_secret" {
description = "arn of the secret to be used for dockerhub authentication"
default = ""
}
variable "enable_exec" {
description = "Whether enable exec command on the task or not"
default = false
}
variable "entrypoint" {
description = "The entry point that's passed to the container."
type = list(string)
default = []
}
variable "secrets" {
description = "Secrets to be passed to the container environment"
default = ""
}
variable "secret_arns" {
description = "Arn of the secrets that are passed to the container environment"
default = null
}
variable "encryption_keys" {
description = "Kms key to decrypt secrets"
type = list(string)
default = []
}
variable "ssm_param_arns" {
description = "Arn of the ssm parameters that are passed to the container environment"
type = list(string)
default = []
}
variable "create_alb" {
description = "Whether to create ALB and related resources"
type = bool
default = true
}