-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathvariables.tf
More file actions
354 lines (294 loc) · 8.49 KB
/
variables.tf
File metadata and controls
354 lines (294 loc) · 8.49 KB
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
# ECS module - variables.tf
variable "name_prefix" {
description = "Prefix to use for all resource names"
type = string
}
variable "environment" {
description = "Environment name (e.g. dev, staging, prod)"
type = string
}
variable "ecr_repository_url" {
description = "URL of the ECR repository"
type = string
}
variable "container_port" {
description = "Port exposed by the docker container"
type = number
}
variable "vpc_id" {
description = "ID of the VPC"
type = string
}
variable "private_subnet_ids" {
description = "IDs of the private subnets"
type = list(string)
}
variable "public_subnet_ids" {
description = "IDs of the public subnets (required for public-facing load balancers)"
type = list(string)
default = null
}
variable "cpu" {
description = "CPU units for the ECS task"
type = number
default = 256
}
variable "memory" {
description = "Memory for the ECS task"
type = number
default = 512
}
variable "desired_count" {
description = "Number of ECS tasks to run"
type = number
default = 1
}
variable "environment_variables" {
description = "Environment variables for the container"
type = map(string)
default = {}
}
variable "tags" {
description = "Additional tags for all resources"
type = map(string)
default = {}
}
variable "container_name" {
description = "Name of the container"
type = string
default = "app"
}
variable "health_check_path" {
description = "Path for the health check"
type = string
default = "/health"
}
variable "deployment_maximum_percent" {
description = "Maximum percent of tasks that can be running during a deployment"
type = number
default = 200
}
variable "deployment_minimum_healthy_percent" {
description = "Minimum percent of tasks that must remain healthy during a deployment"
type = number
default = 100
}
variable "internal_lb" {
description = "Whether the NLB should be internal"
type = bool
default = true
}
variable "admin_lb_internet_facing" {
description = "Whether the admin ALB should be internet-facing (independent of NLB)"
type = bool
default = false
}
variable "lb_deletion_protection" {
description = "Whether the load balancer should have deletion protection enabled"
type = bool
default = false
}
variable "logs_retention_in_days" {
description = "Number of days to retain logs in CloudWatch"
type = number
default = 30
}
# Enhanced API Support Variables
variable "enable_enhanced_monitoring" {
description = "Whether to enable enhanced monitoring for the API"
type = bool
default = false
}
variable "enable_xray_tracing" {
description = "Whether to enable AWS X-Ray tracing for the API"
type = bool
default = false
}
variable "enable_circuit_breaker" {
description = "Whether to enable deployment circuit breaker with rollback"
type = bool
default = true
}
variable "enable_service_discovery" {
description = "Whether to enable AWS Cloud Map service discovery"
type = bool
default = false
}
variable "service_discovery_namespace" {
description = "AWS Cloud Map namespace for service discovery"
type = string
default = ""
}
variable "enable_lb_access_logs" {
description = "Whether to enable ALB access logs"
type = bool
default = false
}
variable "lb_access_logs_bucket" {
description = "S3 bucket for ALB access logs"
type = string
default = ""
}
variable "enable_cross_zone_load_balancing" {
description = "Whether to enable cross-zone load balancing for the ALB"
type = bool
default = true
}
variable "auto_scaling_target_cpu_utilization" {
description = "Target CPU utilization percentage for auto scaling"
type = number
default = 70
}
variable "auto_scaling_max_capacity" {
description = "Maximum number of tasks for auto scaling"
type = number
default = 10
}
variable "auto_scaling_min_capacity" {
description = "Minimum number of tasks for auto scaling"
type = number
default = 2
}
variable "api_rate_limiting" {
description = "Whether to enable API rate limiting at the container level"
type = bool
default = false
}
variable "api_rate_limit_request_per_second" {
description = "Number of API requests allowed per second"
type = number
default = 100
}
variable "enable_container_insights" {
description = "Whether to enable container insights for the ECS cluster"
type = bool
default = true
}
variable "enhanced_metrics_collection_interval" {
description = "Collection interval for enhanced metrics in seconds"
type = number
default = 60
}
# Api Service Configuration
variable "api_command" {
description = "Command to run for web service"
type = list(string)
default = ["poetry", "run", "hypercorn", "src.asgi:application", "--bind", "0.0.0.0:8000"]
}
variable "api_cpu" {
description = "CPU units for web service (1024 = 1 vCPU)"
type = number
default = 1024
}
variable "api_memory" {
description = "Memory in MB for web service"
type = number
default = 2048
}
variable "api_desired_count" {
description = "Number of web service instances"
type = number
default = 1
}
# Celery Configuration
variable "enable_celery_services" {
description = "Enable Celery worker and beat services"
type = bool
default = false
}
variable "admin_allowed_cidrs" {
description = "List of CIDR blocks allowed to access admin interface"
type = list(string)
default = null
}
# Celery Worker Configuration
variable "celery_worker_command" {
description = "Command to run Celery worker"
type = list(string)
default = ["poetry", "run", "celery", "-A", "jao_backend.common.celery", "worker", "--loglevel=INFO", "--concurrency=4"]
}
variable "celery_worker_health_check" {
description = "Health check command for Celery worker"
type = list(string)
default = ["CMD-SHELL", "poetry run celery -A jao_backend.common.celery inspect ping --timeout=10"]
}
variable "celery_worker_concurrency" {
description = "Number of concurrent worker processes"
type = number
default = 4
}
variable "worker_cpu" {
description = "CPU units for worker service (1024 = 1 vCPU)"
type = number
default = 2048
}
variable "worker_memory" {
description = "Memory in MB for worker service"
type = number
default = 8192
}
variable "worker_desired_count" {
description = "Number of worker service instances"
type = number
default = 1
}
# Celery Beat Configuration
variable "celery_beat_command" {
description = "Command to run Celery beat"
type = list(string)
default = ["poetry", "run", "celery", "-A", "jao_backend.common.celery", "beat", "--loglevel=INFO"]
}
variable "celery_beat_health_check" {
description = "Health check command for Celery beat"
type = list(string)
default = ["CMD-SHELL", "poetry run celery -A jao_backend.common.celery inspect ping || exit 1"]
}
variable "beat_cpu" {
description = "CPU units for beat service (1024 = 1 vCPU)"
type = number
default = 256
}
variable "beat_memory" {
description = "Memory in MB for beat service"
type = number
default = 2048
}
variable "enable_worker_autoscaling" {
description = "Enable auto scaling for worker"
default = false
}
variable "worker_min_capacity" {
description = "Minimum capacity for worker service"
type = number
default = 1
}
variable "worker_max_capacity" {
description = "Maximum capacity for worker service"
type = number
default = 10
}
variable "worker_cpu_target_value" {
description = "CPU target for worker service"
type = number
default = 40
}
variable "additional_security_group_ids" {
description = "Additional security group IDs to attach to ECS tasks"
type = list(string)
default = []
}
# Skills Worker Configuration (Python 3.10)
variable "skills_worker_image_url" {
description = "ECR URL for the Python 3.10 skills worker image"
type = string
}
variable "skills_worker_cpu" {
description = "CPU units for skills worker (e.g., 512)"
type = number
default = 512
}
variable "skills_worker_memory" {
description = "Memory for skills worker (e.g., 1024)"
type = number
default = 1024
}