-
-
Save KyMidd/327599fbd06b20ca19b8efdaec831986 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
resource "aws_appautoscaling_scheduled_action" "WeekdayScaleUp" { | |
count = var.enable_scaling ? 1 : 0 | |
name = "${var.ecs_name}ScaleUp" | |
service_namespace = aws_appautoscaling_target.ServiceAutoScalingTarget[0].service_namespace | |
resource_id = aws_appautoscaling_target.ServiceAutoScalingTarget[0].resource_id | |
scalable_dimension = aws_appautoscaling_target.ServiceAutoScalingTarget[0].scalable_dimension | |
schedule = "cron(0 5 ? * MON-FRI *)" #Every weekday at 5 a.m. PST | |
timezone = "America/Los_Angeles" | |
scalable_target_action { | |
min_capacity = var.autoscale_task_weekday_scale_up | |
max_capacity = var.autoscale_task_weekday_scale_up | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment