Skip to content

Commit

Permalink
add cooldown duration for ecs scaling (#14)
Browse files Browse the repository at this point in the history
  • Loading branch information
panchalnimesh authored Jul 3, 2023
1 parent 4451673 commit 21d20f3
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 0 deletions.
2 changes: 2 additions & 0 deletions main.tf
Original file line number Diff line number Diff line change
Expand Up @@ -81,6 +81,8 @@ module "service_cpu_autoscaling_policy" {
min_capacity = lookup(each.value, "service_min_capacity", var.service_min_capacity)
max_capacity = lookup(each.value, "service_max_capacity", var.service_max_capacity)
target_cpu_value = lookup(each.value, "service_target_cpu_value", var.service_target_cpu_value)
scale_in_cooldown = lookup(each.value, "service_scale_in_cooldown", var.service_scale_in_cooldown)
scale_out_cooldown = lookup(each.value, "service_scale_out_cooldown", var.service_scale_out_cooldown)
ecs_cluster_name = module.cluster.ecs_cluster_name
ecs_service_name = module.service[each.key].ecs_service_name
}
12 changes: 12 additions & 0 deletions variables.tf
Original file line number Diff line number Diff line change
Expand Up @@ -255,3 +255,15 @@ variable "service_target_cpu_value" {
type = number
default = 70
}

variable "service_scale_in_cooldown" {
description = "Time between scale in action"
type = number
default = 300
}

variable "service_scale_out_cooldown" {
description = "Time between scale out action"
type = number
default = 300
}

0 comments on commit 21d20f3

Please sign in to comment.