Skip to content
v2.274.0

Schedule Class ​

Schedule for scheduled scaling actions.

Example ​

ts
declare const autoScalingGroup: autoscaling.AutoScalingGroup;

autoScalingGroup.scaleOnSchedule('PrescaleInTheMorning', {
  schedule: autoscaling.Schedule.cron({ hour: '8', minute: '0' }),
  minCapacity: 20,
});

autoScalingGroup.scaleOnSchedule('AllowDownscalingAtNight', {
  schedule: autoscaling.Schedule.cron({ hour: '20', minute: '0' }),
  minCapacity: 1
});

Initializer ​

ts
new Schedule()
python
Schedule()
java
new Schedule()
csharp
new Schedule()
go
NewSchedule()

Properties ​

expressionStringstringexpression_stringstrexpressionStringStringExpressionStringstringExpressionString*stringrequired#
Retrieve the expression for this schedule.

Methods ​

cron(options: CronOptions): Schedule // chainable@staticmethod def cron(options: CronOptions) -> Schedulepublic static Schedule cron(CronOptions options)public static Schedule Cron(CronOptions options)func Cron(Options CronOptions) Schedulestatic#
Create a schedule from a set of cron fields.
expression(expression: string): Schedule // chainable@staticmethod def expression(expression: str) -> Schedulepublic static Schedule expression(String expression)public static Schedule Expression(string expression)func Expression(Expression *string) Schedulestatic#
Construct a schedule from a literal schedule expression.
1 parameter

Parameters

  • expressionexpressionexpressionexpressionExpression — The expression to use.