You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: README.md
+54Lines changed: 54 additions & 0 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -92,6 +92,60 @@ To enable resource limits with custom values, include these parameters in your C
92
92
- Resource limits are disabled by default
93
93
- Values can be specified as percentages or absolute values (for memory-related parameters)
94
94
95
+
## Scheduled Scaling
96
+
97
+
The Elastic CI Stack supports time-based scaling to automatically adjust the minimum number of instances based on your team's working hours. This feature helps optimize costs by scaling down during off-hours while allowing users the ability to proactively scale up capacity ahead of expected increasing capacity requirements.
|`ScheduleTimezone`| Timezone for scheduled actions |`UTC`|
105
+
|`ScaleUpSchedule`| Cron expression for scaling up |`0 8 * * MON-FRI`|
106
+
|`ScaleUpMinSize`| MinSize when scaling up |`1`|
107
+
|`ScaleDownSchedule`| Cron expression for scaling down |`0 18 * * MON-FRI`|
108
+
|`ScaleDownMinSize`| MinSize when scaling down |`0`|
109
+
110
+
### Example Configuration
111
+
112
+
To enable scheduled scaling that maintains a minimum of 10 ASG instances during business hours (8 AM - 6 PM, Eastern Time) and 2 ASG instances during off-hours:
113
+
114
+
```json
115
+
{
116
+
"Parameters": {
117
+
"EnableScheduledScaling": "true",
118
+
"ScheduleTimezone": "America/New_York",
119
+
"ScaleUpSchedule": "0 8 * * MON-FRI",
120
+
"ScaleUpMinSize": "10",
121
+
"ScaleDownSchedule": "0 18 * * MON-FRI",
122
+
"ScaleDownMinSize": "2"
123
+
}
124
+
}
125
+
```
126
+
127
+
### Schedule Format
128
+
129
+
Scheduled scaling uses [AWS Auto Scaling cron expressions](https://docs.aws.amazon.com/autoscaling/ec2/userguide/ec2-auto-scaling-scheduled-scaling.html#scheduled-scaling-cron) with the format:
130
+
```
131
+
minute hour day-of-month month day-of-week
132
+
```
133
+
134
+
Common examples:
135
+
-`0 8 * * MON-FRI` - 8:00 AM on weekdays
136
+
-`0 18 * * MON-FRI` - 6:00 PM on weekdays
137
+
-`0 9 * * SAT` - 9:00 AM on Saturdays
138
+
-`30 7 * * 1-5` - 7:30 AM Monday through Friday (using numbers)
139
+
140
+
### Timezone Support
141
+
142
+
The `ScheduleTimezone` parameter supports [IANA timezone names](https://docs.aws.amazon.com/autoscaling/ec2/userguide/ec2-auto-scaling-scheduled-scaling.html#scheduled-scaling-timezone) such as:
143
+
-`America/New_York` (Eastern Time)
144
+
-`America/Los_Angeles` (Pacific Time)
145
+
-`Europe/London` (Greenwich Mean Time)
146
+
-`Asia/Tokyo` (Japan Standard Time)
147
+
-`UTC` (Coordinated Universal Time)
148
+
95
149
## Development
96
150
97
151
To get started with customizing your own stack, or contributing fixes and features:
Copy file name to clipboardExpand all lines: templates/aws-stack.yml
+88Lines changed: 88 additions & 0 deletions
Original file line number
Diff line number
Diff line change
@@ -81,6 +81,7 @@ Metadata:
81
81
- ImageIdParameter
82
82
- InstanceOperatingSystem
83
83
- InstanceTypes
84
+
- CpuCredits
84
85
- EnableInstanceStorage
85
86
- MountTmpfsAtTmp
86
87
- AgentsPerInstance
@@ -129,6 +130,12 @@ Metadata:
129
130
- ScalerEventSchedulePeriod
130
131
- ScalerMinPollInterval
131
132
- ScalerEnableExperimentalElasticCIMode
133
+
- EnableScheduledScaling
134
+
- ScheduleTimezone
135
+
- ScaleUpSchedule
136
+
- ScaleUpMinSize
137
+
- ScaleDownSchedule
138
+
- ScaleDownMinSize
132
139
133
140
- Label:
134
141
default: Cost Allocation Configuration
@@ -248,6 +255,45 @@ Parameters:
248
255
- "false"
249
256
Default: "false"
250
257
258
+
EnableScheduledScaling:
259
+
Description: Enable scheduled scaling to automatically adjust MinSize based on time-based schedules
260
+
Type: String
261
+
AllowedValues:
262
+
- "true"
263
+
- "false"
264
+
Default: "false"
265
+
266
+
ScheduleTimezone:
267
+
Description: "Timezone for scheduled scaling actions (only used when EnableScheduledScaling is true). See AWS documentation for supported formats: https://docs.aws.amazon.com/autoscaling/ec2/userguide/ec2-auto-scaling-scheduled-scaling.html#scheduled-scaling-timezone (America/New_York, UTC, Europe/London, etc.)"
268
+
Type: String
269
+
Default: "UTC"
270
+
271
+
ScaleUpSchedule:
272
+
Description: "Cron expression for when to scale up (only used when EnableScheduledScaling is true). See AWS documentation for format details: https://docs.aws.amazon.com/autoscaling/ec2/userguide/ec2-auto-scaling-scheduled-scaling.html#scheduled-scaling-cron (\"0 8 * * MON-FRI\" for 8 AM weekdays)"
ConstraintDescription: "Must be a valid cron expression (5 fields: minute hour day-of-month month day-of-week)"
277
+
278
+
ScaleUpMinSize:
279
+
Description: MinSize to set when the ScaleUpSchedule is triggered (applied at the time specified in ScaleUpSchedule, only used when EnableScheduledScaling is true). Cannot exceed MaxSize.
280
+
Type: Number
281
+
Default: 1
282
+
MinValue: 0
283
+
284
+
ScaleDownSchedule:
285
+
Description: "Cron expression for when to scale down (only used when EnableScheduledScaling is true). See AWS documentation for format details: https://docs.aws.amazon.com/autoscaling/ec2/userguide/ec2-auto-scaling-scheduled-scaling.html#scheduled-scaling-cron (\"0 18 * * MON-FRI\" for 6 PM weekdays)"
ConstraintDescription: "Must be a valid cron expression (5 fields: minute hour day-of-month month day-of-week)"
290
+
291
+
ScaleDownMinSize:
292
+
Description: MinSize to set when the ScaleDownSchedule is triggered (applied at the time specified in ScaleDownSchedule, only used when EnableScheduledScaling is true)
293
+
Type: Number
294
+
Default: 0
295
+
MinValue: 0
296
+
251
297
ScaleOutCooldownPeriod:
252
298
Description: Cooldown period in seconds before allowing another scale-out event. Prevents rapid scaling and reduces costs from frequent instance launches.
253
299
Type: Number
@@ -530,6 +576,14 @@ Parameters:
530
576
AllowedPattern: "^[\\w-\\.]+(,[\\w-\\.]*){0,24}$"
531
577
ConstraintDescription: "must contain 1-25 instance types separated by commas. No space before/after the comma."
532
578
579
+
CpuCredits:
580
+
Description: Credit option for CPU usage of burstable instances. Sets the CreditSpecification.CpuCredits property in the LaunchTemplate for T-class instance types (t2, t3, t3a, t4g).
581
+
Type: String
582
+
AllowedValues:
583
+
- standard
584
+
- unlimited
585
+
Default: "unlimited"
586
+
533
587
MaxSize:
534
588
Description: Maximum number of instances. Controls cost ceiling and prevents runaway scaling.
0 commit comments