diff --git a/apps/infra/modules/codedang-infra/ecs-api-admin-service-asg.tf b/apps/infra/modules/codedang-infra/ecs-api-admin-service-asg.tf index 12a8880aed..74fbd9823c 100644 --- a/apps/infra/modules/codedang-infra/ecs-api-admin-service-asg.tf +++ b/apps/infra/modules/codedang-infra/ecs-api-admin-service-asg.tf @@ -54,8 +54,9 @@ resource "aws_appautoscaling_policy" "service_asp_admin_api_scale_up" { service_namespace = aws_appautoscaling_target.service_asg_admin_api.service_namespace step_scaling_policy_configuration { - adjustment_type = "ChangeInCapacity" - cooldown = 60 + adjustment_type = "ChangeInCapacity" + cooldown = 60 + metric_aggregation_type = "Average" step_adjustment { metric_interval_lower_bound = 0 @@ -72,8 +73,9 @@ resource "aws_appautoscaling_policy" "service_asp_admin_api_scale_down" { service_namespace = aws_appautoscaling_target.service_asg_admin_api.service_namespace step_scaling_policy_configuration { - adjustment_type = "ChangeInCapacity" - cooldown = 30 + adjustment_type = "ChangeInCapacity" + cooldown = 30 + metric_aggregation_type = "Average" step_adjustment { metric_interval_upper_bound = -30 diff --git a/apps/infra/modules/codedang-infra/ecs-api-client-service-asg.tf b/apps/infra/modules/codedang-infra/ecs-api-client-service-asg.tf index c21d8c93ce..b0481d5669 100644 --- a/apps/infra/modules/codedang-infra/ecs-api-client-service-asg.tf +++ b/apps/infra/modules/codedang-infra/ecs-api-client-service-asg.tf @@ -54,8 +54,9 @@ resource "aws_appautoscaling_policy" "service_asp_client_api_scale_up" { service_namespace = aws_appautoscaling_target.service_asg_client_api.service_namespace step_scaling_policy_configuration { - adjustment_type = "ChangeInCapacity" - cooldown = 60 + adjustment_type = "ChangeInCapacity" + cooldown = 60 + metric_aggregation_type = "Average" step_adjustment { metric_interval_lower_bound = 0 @@ -72,8 +73,9 @@ resource "aws_appautoscaling_policy" "service_asp_client_api_scale_down" { service_namespace = aws_appautoscaling_target.service_asg_client_api.service_namespace step_scaling_policy_configuration { - adjustment_type = "ChangeInCapacity" - cooldown = 30 + adjustment_type = "ChangeInCapacity" + cooldown = 30 + metric_aggregation_type = "Average" step_adjustment { metric_interval_upper_bound = -30