class ScheduleExpression
Language | Type name |
---|---|
![]() | Amazon.CDK.AWS.Scheduler.Alpha.ScheduleExpression |
![]() | github.com/aws/aws-cdk-go/awscdkscheduleralpha/v2#ScheduleExpression |
![]() | software.amazon.awscdk.services.scheduler.alpha.ScheduleExpression |
![]() | aws_cdk.aws_scheduler_alpha.ScheduleExpression |
![]() | @aws-cdk/aws-scheduler-alpha ยป ScheduleExpression |
ScheduleExpression for EventBridge Schedule.
You can choose from three schedule types when configuring your schedule: rate-based, cron-based, and one-time schedules. Both rate-based and cron-based schedules are recurring schedules.
See also: https://docs.aws.amazon.com/scheduler/latest/UserGuide/schedule-types.html
Example
// The code below shows an example of how to instantiate this type.
// The values are placeholders you should change.
import * as scheduler_alpha from '@aws-cdk/aws-scheduler-alpha';
import * as cdk from 'aws-cdk-lib';
declare const timeZone: cdk.TimeZone;
const scheduleExpression = scheduler_alpha.ScheduleExpression.at(new Date(), /* all optional props */ timeZone);
Initializer
new ScheduleExpression()
Properties
Name | Type | Description |
---|---|---|
expression | string | Retrieve the expression for this schedule. |
time | Time | Retrieve the expression for this schedule. |
expressionString
Type:
string
Retrieve the expression for this schedule.
timeZone?
Type:
Time
(optional)
Retrieve the expression for this schedule.
Methods
Name | Description |
---|---|
static at(date, timeZone?) | Construct a one-time schedule from a date. |
static cron(options) | Create a recurring schedule from a set of cron fields and time zone. |
static expression(expression, timeZone?) | Construct a schedule from a literal schedule expression. |
static rate(duration) | Construct a recurring schedule from an interval and a time unit. |
static at(date, timeZone?)
public static at(date: date, timeZone?: TimeZone): ScheduleExpression
Parameters
- date
date
โ The date and time to use. - timeZone
Time
โ The time zone to use for interpreting the date.Zone
Returns
Construct a one-time schedule from a date.
static cron(options)
public static cron(options: CronOptionsWithTimezone): ScheduleExpression
Parameters
- options
Cron
Options With Timezone
Returns
Create a recurring schedule from a set of cron fields and time zone.
static expression(expression, timeZone?)
public static expression(expression: string, timeZone?: TimeZone): ScheduleExpression
Parameters
- expression
string
โ The expression to use. - timeZone
Time
โ The time zone to use for interpreting the expression.Zone
Returns
Construct a schedule from a literal schedule expression.
static rate(duration)
public static rate(duration: Duration): ScheduleExpression
Parameters
- duration
Duration
Returns
Construct a recurring schedule from an interval and a time unit.
Rates may be defined with any unit of time, but when converted into minutes, the duration must be a positive whole number of minutes.