-
Notifications
You must be signed in to change notification settings - Fork 7
Expand file tree
/
Copy pathmain.tf
More file actions
38 lines (29 loc) · 963 Bytes
/
main.tf
File metadata and controls
38 lines (29 loc) · 963 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
# Scheduled Scaling Configuration
#
# This example shows time-based scaling for predictable workloads.
# Saves costs by reducing capacity during off-hours.
terraform {
required_version = ">= 1.0"
}
module "buildkite_stack" {
source = "buildkite/elastic-ci-stack-for-aws/buildkite"
version = "0.6.7"
stack_name = "buildkite-scheduled"
buildkite_queue = "default"
buildkite_agent_token = var.buildkite_agent_token
# Base scaling configuration
min_size = 0
max_size = 20
# Enable scheduled scaling
enable_scheduled_scaling = true
schedule_timezone = "America/New_York"
# Scale up weekdays at 8 AM
scale_up_schedule = "0 8 * * MON-FRI"
scale_up_min_size = 5
# Scale down weekdays at 6 PM
scale_down_schedule = "0 18 * * MON-FRI"
scale_down_min_size = 0
instance_types = "t3.large,t3.xlarge"
# Keep instances for multiple jobs during business hours
scale_in_idle_period = 1800 # 30 minutes
}