diff --git a/apps/infra/production/codedang/codedang_service_client.tf b/apps/infra/production/codedang/codedang_service_client.tf index ad7e03d6d3..f4a1a07f28 100644 --- a/apps/infra/production/codedang/codedang_service_client.tf +++ b/apps/infra/production/codedang/codedang_service_client.tf @@ -107,7 +107,7 @@ module "client_api" { ecs_service = { name = "Codedang-Client-Api-Service" cluster_arn = module.codedang_api.ecs_cluster.arn - desired_count = 2 + desired_count = 1 load_balancer = { container_name = "Codedang-Client-Api" container_port = 4000 @@ -116,7 +116,7 @@ module "client_api" { } appautoscaling_target = { - min_capacity = 2 + min_capacity = 1 max_capacity = 8 resource_id = { cluster_name = module.codedang_api.ecs_cluster.name diff --git a/apps/infra/production/codedang/modules/cluster_autoscaling/cluster.tf b/apps/infra/production/codedang/modules/cluster_autoscaling/cluster.tf index 777967f6bf..244f823d72 100644 --- a/apps/infra/production/codedang/modules/cluster_autoscaling/cluster.tf +++ b/apps/infra/production/codedang/modules/cluster_autoscaling/cluster.tf @@ -2,13 +2,13 @@ resource "aws_ecs_cluster" "this" { name = var.ecs_cluster_name } -resource "aws_ecs_cluster_capacity_providers" "this" { - cluster_name = aws_ecs_cluster.this.name - capacity_providers = [aws_ecs_capacity_provider.this.name] +# resource "aws_ecs_cluster_capacity_providers" "this" { +# cluster_name = aws_ecs_cluster.this.name +# capacity_providers = [aws_ecs_capacity_provider.this.name] - default_capacity_provider_strategy { - capacity_provider = aws_ecs_capacity_provider.this.name - weight = 1 - base = 1 - } -} +# default_capacity_provider_strategy { +# capacity_provider = aws_ecs_capacity_provider.this.name +# weight = 1 +# base = 1 +# } +# } diff --git a/apps/infra/production/codedang/modules/service_autoscaling/ecs_service.tf b/apps/infra/production/codedang/modules/service_autoscaling/ecs_service.tf index 21ce84fe99..71e5778531 100644 --- a/apps/infra/production/codedang/modules/service_autoscaling/ecs_service.tf +++ b/apps/infra/production/codedang/modules/service_autoscaling/ecs_service.tf @@ -1,7 +1,7 @@ resource "aws_ecs_task_definition" "this" { family = var.task_definition.family - requires_compatibilities = ["EC2"] - network_mode = "bridge" + requires_compatibilities = ["FARGATE"] + network_mode = "awsvpc" cpu = var.task_definition.cpu memory = var.task_definition.memory container_definitions = var.task_definition.container_definitions @@ -14,7 +14,7 @@ resource "aws_ecs_service" "this" { cluster = var.ecs_service.cluster_arn task_definition = aws_ecs_task_definition.this.family desired_count = var.ecs_service.desired_count - launch_type = "EC2" + launch_type = "FARGATE" force_new_deployment = true dynamic "load_balancer" {