Skip to content

Commit 576d333

Browse files
committed
Assign the same CPU & memory to the record processor ECS task and container. Reduce the overall value to somewhere in the middle.
1 parent 9d001c9 commit 576d333

File tree

1 file changed

+6
-7
lines changed

1 file changed

+6
-7
lines changed

terraform/ecs_batch_processor_config.tf

Lines changed: 6 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -184,8 +184,8 @@ resource "aws_ecs_task_definition" "ecs_task" {
184184
family = "${local.short_prefix}-processor-task"
185185
network_mode = "awsvpc"
186186
requires_compatibilities = ["FARGATE"]
187-
cpu = "8192"
188-
memory = "24576"
187+
cpu = 4096
188+
memory = 16384
189189
runtime_platform {
190190
operating_system_family = "LINUX"
191191
cpu_architecture = "X86_64"
@@ -196,6 +196,8 @@ resource "aws_ecs_task_definition" "ecs_task" {
196196
container_definitions = jsonencode([{
197197
name = "${local.short_prefix}-process-records-container"
198198
image = "${aws_ecr_repository.processing_repository.repository_url}:${local.image_tag}"
199+
cpu = 4096
200+
memory = 16384
199201
essential = true
200202
environment = [
201203
{
@@ -263,6 +265,7 @@ resource "aws_iam_role" "fifo_pipe_role" {
263265
]
264266
})
265267
}
268+
266269
resource "aws_iam_policy" "fifo_pipe_policy" {
267270
name = "${local.short_prefix}-fifo-pipe-policy"
268271
policy = jsonencode({
@@ -320,7 +323,6 @@ resource "aws_iam_role_policy_attachment" "fifo_pipe_policy_attachment" {
320323
policy_arn = aws_iam_policy.fifo_pipe_policy.arn
321324
}
322325

323-
324326
# EventBridge Pipe
325327
resource "aws_pipes_pipe" "fifo_pipe" {
326328
name = "${local.short_prefix}-pipe"
@@ -340,20 +342,17 @@ resource "aws_pipes_pipe" "fifo_pipe" {
340342
}
341343
overrides {
342344
container_override {
343-
cpu = 2048
344345
name = "${local.short_prefix}-process-records-container"
345346
environment {
346347
name = "EVENT_DETAILS"
347348
value = "$.body"
348349
}
349-
memory = 8192
350-
memory_reservation = 1024
351350
}
352351
}
353352
task_count = 1
354353
}
355-
356354
}
355+
357356
log_configuration {
358357
include_execution_data = ["ALL"]
359358
level = "ERROR"

0 commit comments

Comments
 (0)