Created
April 17, 2020 10:03
-
-
Save akskap/948ed1fa87d14ba348b85716f6690f37 to your computer and use it in GitHub Desktop.
Gitlab Runner Autoscaling Group Shutdown/Startup
This file contains hidden or 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_autoscaling_schedule" "gitlab_asg_shutdown_schedule" { | |
autoscaling_group_name = "${aws_autoscaling_group.gitlab_runner_autoscaling_group.name}" | |
scheduled_action_name = "gitlab-runner-cluster-shutdown" | |
recurrence = "30 19 * * Mon-Fri" | |
min_size = 0 | |
max_size = 0 | |
desired_capacity = 0 | |
} | |
resource "aws_autoscaling_schedule" "gitlab_asg_startup_schedule" { | |
autoscaling_group_name = "${aws_autoscaling_group.gitlab_runner_autoscaling_group.name}" | |
scheduled_action_name = "gitlab-runner-cluster-startup" | |
recurrence = "30 06 * * Mon-Fri" | |
min_size = "${var.min_instance_size}" | |
max_size = 10 | |
desired_capacity = "${var.desired_capacity}" | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment