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
+68Lines changed: 68 additions & 0 deletions
Original file line number
Diff line number
Diff line change
@@ -130,6 +130,12 @@ Metadata:
130
130
- ScalerEventSchedulePeriod
131
131
- ScalerMinPollInterval
132
132
- ScalerEnableExperimentalElasticCIMode
133
+
- EnableScheduledScaling
134
+
- ScheduleTimezone
135
+
- ScaleUpSchedule
136
+
- ScaleUpMinSize
137
+
- ScaleDownSchedule
138
+
- ScaleDownMinSize
133
139
134
140
- Label:
135
141
default: Cost Allocation Configuration
@@ -231,6 +237,45 @@ Parameters:
231
237
- "false"
232
238
Default: "false"
233
239
240
+
EnableScheduledScaling:
241
+
Description: Enable scheduled scaling to automatically adjust MinSize based on time-based schedules
242
+
Type: String
243
+
AllowedValues:
244
+
- "true"
245
+
- "false"
246
+
Default: "false"
247
+
248
+
ScheduleTimezone:
249
+
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.)"
250
+
Type: String
251
+
Default: "UTC"
252
+
253
+
ScaleUpSchedule:
254
+
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)"
259
+
260
+
ScaleUpMinSize:
261
+
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.
262
+
Type: Number
263
+
Default: 1
264
+
MinValue: 0
265
+
266
+
ScaleDownSchedule:
267
+
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)"
272
+
273
+
ScaleDownMinSize:
274
+
Description: MinSize to set when the ScaleDownSchedule is triggered (applied at the time specified in ScaleDownSchedule, only used when EnableScheduledScaling is true)
275
+
Type: Number
276
+
Default: 0
277
+
MinValue: 0
278
+
234
279
ScaleOutCooldownPeriod:
235
280
Description: Cooldown period in seconds before allowing another scale-out event
0 commit comments