class Schedule
Language | Type name |
---|---|
![]() | Amazon.CDK.AWS.ApplicationAutoScaling.Schedule |
![]() | software.amazon.awscdk.services.applicationautoscaling.Schedule |
![]() | aws_cdk.aws_applicationautoscaling.Schedule |
![]() | @aws-cdk/aws-applicationautoscaling » Schedule |
Schedule for scheduled scaling actions.
Example
declare const resource: SomeScalableResource;
const capacity = resource.autoScaleCapacity({
minCapacity: 1,
maxCapacity: 50,
});
capacity.scaleOnSchedule('PrescaleInTheMorning', {
schedule: appscaling.Schedule.cron({ hour: '8', minute: '0' }),
minCapacity: 20,
});
capacity.scaleOnSchedule('AllowDownscalingAtNight', {
schedule: appscaling.Schedule.cron({ hour: '20', minute: '0' }),
minCapacity: 1
});
Initializer
new Schedule()
Properties
Name | Type | Description |
---|---|---|
expression | string | Retrieve the expression for this schedule. |
expressionString
Type:
string
Retrieve the expression for this schedule.
Methods
Name | Description |
---|---|
static at(moment) | Construct a Schedule from a moment in time. |
static cron(options) | Create a schedule from a set of cron fields. |
static expression(expression) | Construct a schedule from a literal schedule expression. |
static rate(duration) | Construct a schedule from an interval and a time unit. |
static at(moment)
public static at(moment: date): Schedule
Parameters
- moment
date
Returns
Construct a Schedule from a moment in time.
static cron(options)
public static cron(options: CronOptions): Schedule
Parameters
- options
Cron
Options
Returns
Create a schedule from a set of cron fields.
static expression(expression)
public static expression(expression: string): Schedule
Parameters
- expression
string
— The expression to use.
Returns
Construct a schedule from a literal schedule expression.
static rate(duration)
public static rate(duration: Duration): Schedule
Parameters
- duration
Duration
Returns
Construct a schedule from an interval and a time unit.