Skip to content

Commit

Permalink
fix(infra): add metricAggregationType in asg (#1683)
Browse files Browse the repository at this point in the history
fix: add metricAggregationType in asg
  • Loading branch information
k1g99 authored May 10, 2024
1 parent 89420c7 commit d8dbfde
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 8 deletions.
10 changes: 6 additions & 4 deletions apps/infra/modules/codedang-infra/ecs-api-admin-service-asg.tf
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -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
Expand Down
10 changes: 6 additions & 4 deletions apps/infra/modules/codedang-infra/ecs-api-client-service-asg.tf
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -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
Expand Down

0 comments on commit d8dbfde

Please sign in to comment.