forked from philips-software/terraform-aws-ecs-service
-
Notifications
You must be signed in to change notification settings - Fork 0
/
variables.tf
273 lines (226 loc) · 7.66 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
variable "environment" {
description = "Name of the environment (e.g. project-dev); will be prefixed to all resources."
type = string
}
variable "project" {
description = "Project cost center / cost allocation."
type = string
}
variable "ecs_cluster_id" {
description = "The id of the ECS cluster where this service will be launched."
type = string
}
variable "docker_repository" {
description = "The location of the docker repository (e.g. 123456789.dkr.ecr.eu-west-1.amazonaws.com)."
type = string
default = "docker.io"
}
variable "docker_image_tag" {
description = "The docker image version (e.g. 1.0.0 or latest)."
type = string
default = "latest"
}
variable "docker_image" {
description = "Name of te docker image."
type = string
}
variable "container_memory" {
description = "Memory to be assigned to the container."
type = number
default = 400
}
variable "container_cpu" {
description = "CPU shares to be assigned to the container."
type = string
default = ""
}
variable "docker_environment_vars" {
description = "A JSON formated array of tuples of docker enviroment variables."
type = string
default = ""
}
variable "service_name" {
description = "Name of the service to be created."
type = string
}
variable "docker_logging_config" {
description = "The configuration for docker container logging"
type = string
default = ""
}
variable "desired_count" {
description = "The number of desired tasks"
type = number
default = 1
}
variable "task_role_arn" {
description = "The ARN of IAM role that allows your Amazon ECS container task to make calls to other AWS services."
type = string
default = ""
}
// ------
// ALB specific variables
// ------
variable "enable_alb" {
description = "If true an ALB is created."
type = bool
default = false
}
variable "alb_protocol" {
description = "Defines the ALB protocol to be used."
default = "HTTPS"
}
variable "alb_port" {
description = "Defines to port for the ALB."
type = number
default = 443
}
variable "alb_certificate_arn" {
description = "The AWS certificate ARN, required for an ALB via HTTPS. The certificate should be available in the same zone."
type = string
default = ""
}
variable "alb_timeout" {
description = "The idle timeout in seconds of the ALB"
type = number
default = 60
}
variable "health_check_matcher" {
description = "HTTP result code used for health validation."
type = string
default = "200-399"
}
variable "health_check_path" {
description = "The url path part for the health check endpoint."
type = string
default = "/"
}
variable "health_check_interval" {
description = "The approximate amount of time, in seconds, between health checks of an individual target. Minimum value 5 seconds, Maximum value 300 seconds. Default 30 seconds."
type = string
default = "30"
}
variable "health_check_grace_period_seconds" {
description = "Seconds to ignore failing load balancer health checks on newly instantiated tasks to prevent premature shutdown, up to 1800. Only valid for services configured to use load balancers."
type = string
default = "0"
}
variable "ecs_service_role" {
description = "ECS service role."
type = string
default = ""
}
variable "container_ssl_enabled" {
description = "Set to true if container has SSL enabled. This requires that the container can handle HTTPS traffic."
type = bool
default = false
}
variable "container_port" {
description = "The container port to be exported to the host."
type = string
}
variable "enable_dns" {
description = "Enable creation of DNS record."
type = bool
default = true
}
variable "dns_zone_id" {
description = "The ID of the DNS zone."
type = string
default = ""
}
variable "dns_name" {
description = "The name DNS name."
type = string
default = ""
}
variable "vpc_id" {
description = "The VPC to launch the ALB in in (e.g. vpc-66ecaa02)."
type = string
default = ""
}
variable "subnet_ids" {
description = "List of subnet itd to deploy the ALB."
type = list(string)
default = []
}
variable "internal_alb" {
description = "If true this ALB is only available within the VPC, default (false) is publicly accessable (internetfacing)."
type = bool
default = false
}
variable "docker_mount_points" {
description = "Defines the the mount point for the container."
type = string
default = ""
}
variable "volumes" {
description = "Defines the volumes that can be mounted to a container."
type = list(map(string))
default = []
}
// ------
// Monitoring specific variables
// ------
variable "enable_monitoring" {
description = "If true monitoring alerts will be created if needed."
type = bool
default = true
}
variable "monitoring_sns_topic_arn" {
description = "ARN for the SNS topic to send alerts to."
type = string
default = ""
}
variable "ecs_cluster_name" {
description = "The name of the ECS cluster where this service will be launched."
type = string
}
variable "tags" {
description = "A map of tags to add to the resources"
type = map(string)
default = {}
}
variable "ssl_policy" {
description = "SSL policy applied to an SSL enabled ALB, see https://docs.aws.amazon.com/elasticloadbalancing/latest/classic/elb-security-policy-table.html"
type = string
default = "ELBSecurityPolicy-TLS-1-2-2017-01"
}
variable "enable_target_group_connection" {
description = "If `true` a load balancer is created for the service which will be connected to the target group specified in `target_group_arn`. Creating a load balancer for an ecs service requires a target group with a connected load balancer. To ensure the right order of creation, provide a list of depended arns in `ecs_services_dependencies`"
type = bool
default = false
}
variable "enable_load_balanced" {
description = "Enables load balancing for a service by creating a target group and listener rule. This option should NOT be used together with `enable_target_group_connection` delegates the creation of the target group to component that use this module."
type = bool
default = false
}
variable "target_group_arn" {
description = "Required for `enable_target_group_connection` provides the target group arn to be connected to the ecs load balancer. Ensure you provide the arns of the listeners or listeners rule conntected to the target group as `ecs_services_dependencies`."
type = string
default = ""
}
variable "listener_arn" {
description = "Required for `enable_load_balanced`, provide the arn of the listener connected to a load balancer. By default a rule to the root of the listener will be created."
type = string
default = ""
}
variable "health_check" {
description = "Health check for the target group, will overwrite the defaults (merged). Defaults: `protocol=HTTP or HTTPS` depends on `container_ssl`, `path=/`, `matcher=200-399` and `interval=30`."
type = map(string)
default = {}
}
variable "lb_listener_rule_condition" {
description = "The condition for the LB listener rule which is created when `enable_load_balanced` is set."
type = map(string)
default = {
field = "path-pattern"
values = "/*"
}
}
variable "ecs_services_dependencies" {
description = "A list of arns can be provided to which the creation of the ecs service is depended."
type = list(string)
default = []
}