-
Notifications
You must be signed in to change notification settings - Fork 3
/
variables.tf
290 lines (249 loc) · 7.98 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
variable "first_run" {
type = bool
description = <<EOT
If the microservices is being created, this should be set to true, otherwise false.
When applying subsequent times (updating the infra, rather than creating from scratch), this should be
set to false, which will cause the image version being deployed to be the same version as is currently
deployed. Without it the latest image will be deployed, which is almost never wanted behaviour as new
versions should be deployed via CI/CD not terraform.
A value of true should not be committed to source control, but only updated locally when applying for
the first time for the given service.
EOT
default = false
}
variable "region" {
type = string
default = "eu-west-1"
description = "The AWS region to deploy the compute module in"
}
variable "microservice_container" {
type = object({
name = string
image = string
cpu = number
memory = number
})
description = "Settings for the microservice container"
}
variable "port" {
type = number
description = "The port that will be used for port mapping <HOST>:<CONTAINER>"
default = 8080
}
variable "cpu" {
type = number
description = "The total vCPU to allocate for the ECS service. Valid configuration at https://docs.aws.amazon.com/AmazonECS/latest/developerguide/AWS_Fargate.html "
default = 512
}
variable "memory" {
type = number
description = "The total memory to allocate for the ECS service. Valid configuration at https://docs.aws.amazon.com/AmazonECS/latest/developerguide/AWS_Fargate.html"
default = 2048
}
variable "xray_cpu" {
type = number
description = "The total vCPU to allocate to the xray container"
default = 32
}
variable "xray_memory" {
type = number
description = "The total memory to allocate to the xray container"
default = 256
}
variable "envoy_cpu" {
type = number
description = "The total vCPU to allocate to the envoy container"
default = 256
}
variable "envoy_memory" {
type = number
description = "The total memory to allocate to the envoy container"
default = 512
}
variable "microservice_cpu" {
type = number
description = "The total vCPU to allocate to the microservice"
default = 224
}
variable "microservice_memory" {
type = number
description = "The total memory to allocate to the microservice"
default = 1280
}
variable "ecs_cluster_name" {
type = string
description = "The ECS cluster to deploy the ECS Fargate into"
}
variable "app_name" {
type = string
description = "The shared name for the ECS Fargate service and task definitions"
}
variable "task_execution_role_arn" {
type = string
description = "The name of the execution role to use with the service"
default = ""
}
variable "task_role_arn" {
type = string
description = "The name of the task role to use with the service"
default = ""
}
variable "deployment_controller_type" {
type = string
description = "The deployment controller type to use in ECS service. For blue/green, CODE_DEPLOY must be used"
default = "ECS"
}
variable "envoy_container_name" {
type = string
description = "The name of the envoy container to be used in AppMesh proxy"
default = "envoy"
}
variable "envoy_ignored_uid" {
type = string
description = "Which UID to ignore in envoy docker container"
default = "1337"
}
variable "service_discovery_dns_routing_policy" {
type = string
description = "The routing policy that you want to apply to all records that Route 53 creates when you register an instance and specify the service. Valid Values: MULTIVALUE, WEIGHTED"
default = "MULTIVALUE"
}
variable "cloud_map" {
type = object({
namespace = object({
name = string
id = string
})
service = object({
name = string
})
})
description = "Settings needed to setup service discovery through AWS CloudMap"
}
variable "env_variables" {
type = list(object({
name = string
value = string
}))
description = "Environment variables for the service."
default = null
}
variable "secrets" {
type = list(object({
name = string
valueFrom = string
}))
description = "Secrets for the service. Use arn of parameters in parameter store for the valueFrom property"
default = null
}
variable "vpc_id" {
type = string
description = "The VPC to use"
}
variable "subnet_ids" {
type = list(string)
description = "The subnets for the ECS service network configuration"
}
variable "appmesh_name" {
type = string
description = "Name of AppMesh to register service components in"
}
variable "tags" {
type = map(string)
}
variable "load_balancers" {
type = list(object({
target_group_arn = string
}))
description = "Load balancer config to be used in ECS service"
default = null
}
variable "awslogs_datetime_format" {
type = string
description = "The format used in logs written by the application in the container. Used for ensuring that the aws log driver can parse the logs correctly and not split them into several entries (e.g. stack traces are kept in one entry)."
default = "%Y-%m-%d %H:%M:%S"
}
variable "autoscaling" {
type = object({
enabled = bool
name = string
namespace = string
stage = string
attributes = list(string)
min_capacity = number
max_capacity = number
})
default = null
description = "Used to define and enable autoscaling for the ECS service"
}
variable "autoscaling_alarm_description" {
type = string
description = "The string to format and use as the alarm description"
default = "Average service %v utilization %v last %d minute(s) over %v period(s)"
}
variable "autoscaling_delimiter" {
type = string
default = "-"
description = "Delimiter between `namespace`, `stage`, `name` and `attributes`"
}
variable "autoscaling_cpu" {
type = object({
utilization_target_value = number
scale_in_period = number
scale_out_period = number
})
default = null
description = "Used to define autoscaling based on CPU usage"
}
variable "autoscaling_memory" {
type = object({
utilization_target_value = number
scale_in_period = number
scale_out_period = number
})
default = null
description = "Used to define autoscaling based on Memory usage"
}
variable "instance_count" {
type = number
description = "The number of instances to run in the ECS service"
default = 1
}
variable "appmesh_virtual_service_name" {
type = string
description = "Name of AppMesh virtual service"
default = null
}
variable "appmesh_virtual_node_backend_service" {
type = string
description = "Name of virtual service for AppMesh virtual node backend"
default = null
}
variable "appmesh_virtual_node_http_idle_timeout" {
type = number
description = "The idle timeout for HTTP requests to the node in seconds"
default = 15
}
variable "appmesh_virtual_route_http_idle_timeout" {
type = number
description = "The idle timeout for HTTP requests to the route in seconds"
default = 15
}
variable "appmesh_virtual_node_http_request_timeout" {
type = number
description = "The request timeout for HTTP requests to the node in seconds"
default = 15
}
variable "appmesh_virtual_route_http_request_timeout" {
type = number
description = "The request timeout for HTTP requests to the route in seconds"
default = 15
}
variable "envoy_additional_configuration" {
type = list(object({
name = string
value = string
}))
description = "Map of envoy additional environment variables. (https://docs.aws.amazon.com/app-mesh/latest/userguide/envoy-config.html)"
default = []
}