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