From e462f0fc4b026fa645d988bd3e11752bf1a9a803 Mon Sep 17 00:00:00 2001 From: Eunsu Kang <56429615+ssupecial@users.noreply.github.com> Date: Sun, 21 Jul 2024 22:09:45 +0900 Subject: [PATCH] feat(infra): change api ecs cpu soft limit and delete memory hard limit (#1837) * feat(infra): change admin-api and client-api container definition's cpu resource from 924 to 600 * feat(infra): delete admin-api and client-api task defintion's memory hard limit * fix(infra): modify memory optional to task_definition variable --- apps/infra/production/codedang/codedang_service_admin.tf | 2 +- apps/infra/production/codedang/codedang_service_client.tf | 2 +- .../production/codedang/container_definitions/admin_api.json | 2 +- .../production/codedang/container_definitions/client_api.json | 2 +- .../codedang/modules/service_autoscaling/variables.tf | 2 +- 5 files changed, 5 insertions(+), 5 deletions(-) diff --git a/apps/infra/production/codedang/codedang_service_admin.tf b/apps/infra/production/codedang/codedang_service_admin.tf index 8175c66494..0a0c36a895 100644 --- a/apps/infra/production/codedang/codedang_service_admin.tf +++ b/apps/infra/production/codedang/codedang_service_admin.tf @@ -30,7 +30,7 @@ module "admin_api" { #TODO task_definition = { family = "Codedang-Admin-Api" - memory = 950 + # memory = 950 container_definitions = jsonencode([ jsondecode(templatefile("container_definitions/admin_api.json", { ecr_uri = data.aws_ecr_repository.admin_api.repository_url, diff --git a/apps/infra/production/codedang/codedang_service_client.tf b/apps/infra/production/codedang/codedang_service_client.tf index 3fb482243d..2080dd9e3a 100644 --- a/apps/infra/production/codedang/codedang_service_client.tf +++ b/apps/infra/production/codedang/codedang_service_client.tf @@ -30,7 +30,7 @@ module "client_api" { #TODO task_definition = { family = "Codedang-Client-Api" - memory = 950 + # memory = 950 container_definitions = jsonencode([ jsondecode(templatefile("container_definitions/client_api.json", { diff --git a/apps/infra/production/codedang/container_definitions/admin_api.json b/apps/infra/production/codedang/container_definitions/admin_api.json index 31f7c5b145..22bb4c03bd 100644 --- a/apps/infra/production/codedang/container_definitions/admin_api.json +++ b/apps/infra/production/codedang/container_definitions/admin_api.json @@ -1,7 +1,7 @@ { "name": "Codedang-Admin-Api", "image": "${ecr_uri}", - "cpu": 924, + "cpu": 600, "memoryReservation": 512, "essential": true, "portMappings": [ diff --git a/apps/infra/production/codedang/container_definitions/client_api.json b/apps/infra/production/codedang/container_definitions/client_api.json index 9a69015f95..1fc90fd910 100644 --- a/apps/infra/production/codedang/container_definitions/client_api.json +++ b/apps/infra/production/codedang/container_definitions/client_api.json @@ -1,7 +1,7 @@ { "name": "Codedang-Client-Api", "image": "${ecr_uri}", - "cpu": 924, + "cpu": 600, "memoryReservation": 512, "essential": true, "portMappings": [ diff --git a/apps/infra/production/codedang/modules/service_autoscaling/variables.tf b/apps/infra/production/codedang/modules/service_autoscaling/variables.tf index 9181be1cba..77fc4051d6 100644 --- a/apps/infra/production/codedang/modules/service_autoscaling/variables.tf +++ b/apps/infra/production/codedang/modules/service_autoscaling/variables.tf @@ -2,7 +2,7 @@ variable "task_definition" { type = object({ family = string cpu = optional(number) - memory = number + memory = optional(number) container_definitions = any execution_role_arn = string })