Skip to content

Commit

Permalink
added cooldown to ecs policy
Browse files Browse the repository at this point in the history
  • Loading branch information
laurentb4 committed Aug 9, 2024
1 parent 846ebf4 commit 48036b2
Showing 1 changed file with 4 additions and 3 deletions.
7 changes: 4 additions & 3 deletions modules/ecs_auto_scaling_radius/main.tf
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@ resource "aws_appautoscaling_policy" "ecs_policy_up" {
step_scaling_policy_configuration {
adjustment_type = "ChangeInCapacity"
metric_aggregation_type = "Average"
cooldown = 300

step_adjustment {
metric_interval_lower_bound = 0
Expand Down Expand Up @@ -254,15 +255,15 @@ resource "aws_cloudwatch_metric_alarm" "cpu_utilization_alarm" {
metric_name = "CPUUtilization"
namespace = "AWS/ECS"
period = "60"
statistic = "Average"
threshold = "80"
statistic = "Maximum"
threshold = "90"

dimensions = {
ClusterName = var.cluster_name
ServiceName = var.service_name
}

alarm_description = "This alarm tells ECS to scale up based on CPU utilisation with Average statistics"
alarm_description = "This alarm tells ECS to scale up based on CPU utilisation with Maximum statistics"

alarm_actions = [
aws_appautoscaling_policy.ecs_policy_up.arn
Expand Down

0 comments on commit 48036b2

Please sign in to comment.