From d8dbfdee94766eaea612253081d9595f5965f2ca Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=EA=B9=80=EC=9D=BC=EA=B1=B4?= <100272259+k1g99@users.noreply.github.com> Date: Fri, 10 May 2024 17:59:09 +0900 Subject: [PATCH] fix(infra): add metricAggregationType in asg (#1683) fix: add metricAggregationType in asg --- .../codedang-infra/ecs-api-admin-service-asg.tf | 10 ++++++---- .../codedang-infra/ecs-api-client-service-asg.tf | 10 ++++++---- 2 files changed, 12 insertions(+), 8 deletions(-) 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