class Schedule
| Language | Type name | 
|---|---|
|  .NET | Amazon.CDK.AWS.Synthetics.Schedule | 
|  Go | github.com/aws/aws-cdk-go/awscdk/v2/awssynthetics#Schedule | 
|  Java | software.amazon.awscdk.services.synthetics.Schedule | 
|  Python | aws_cdk.aws_synthetics.Schedule | 
|  TypeScript (source) | aws-cdk-lib»aws_synthetics»Schedule | 
Schedule for canary runs.
Example
const canary = new synthetics.Canary(this, 'MyCanary', {
  schedule: synthetics.Schedule.rate(Duration.minutes(5)),
  test: synthetics.Test.custom({
    handler: 'canary.handler',
    code: synthetics.Code.fromAsset(path.join(__dirname, 'canaries')),
  }),
  runtime: synthetics.Runtime.SYNTHETICS_PYTHON_SELENIUM_5_1,
  maxRetries: 2, // The canary run will retry up to 2 times on a failure
});
Properties
| Name | Type | Description | 
|---|---|---|
| expression | string | The Schedule expression. | 
expressionString
Type:
string
The Schedule expression.
Methods
| Name | Description | 
|---|---|
| static cron(options) | Create a schedule from a set of cron fields. | 
| static expression(expression) | Construct a schedule from a literal schedule expression. | 
| static once() | The canary will be executed once. | 
| static rate(interval) | Construct a schedule from an interval. | 
static cron(options)
public static cron(options: CronOptions): Schedule
Parameters
- options CronOptions 
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.
The expression must be in a rate(number units) format.
For example, Schedule.expression('rate(10 minutes)')
static once()
public static once(): Schedule
Returns
The canary will be executed once.
static rate(interval)
public static rate(interval: Duration): Schedule
Parameters
- interval Duration— The interval at which to run the canary.
Returns
Construct a schedule from an interval.
Allowed values: 0 (for a single run) or between 1 and 60 minutes.
To specify a single run, you can use Schedule.once().
