forked from DNXLabs/terraform-aws-eb-windows
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathasg-scheduler.tf
23 lines (20 loc) · 843 Bytes
/
asg-scheduler.tf
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
locals {
}
resource "aws_autoscaling_schedule" "ecs_stop" {
count = var.enable_schedule ? 1 : 0
scheduled_action_name = "eb-${var.name}-${var.environment}-stop"
min_size = 0
max_size = 0
desired_capacity = 0
autoscaling_group_name = aws_elastic_beanstalk_environment.env.autoscaling_groups[0]
recurrence = var.schedule_cron_stop
}
resource "aws_autoscaling_schedule" "ecs_start" {
count = var.enable_schedule ? 1 : 0
scheduled_action_name = "eb-${var.name}-${var.environment}-start"
min_size = var.asg_min
max_size = var.asg_max
desired_capacity = var.asg_min
autoscaling_group_name = aws_elastic_beanstalk_environment.env.autoscaling_groups[0]
recurrence = var.schedule_cron_start
}