ScheduleExpression Class
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.
Example
ts
import * as firehose from 'aws-cdk-lib/aws-kinesisfirehose';
declare const deliveryStream: firehose.IDeliveryStream;
const payload = {
Data: "record",
};
new Schedule(this, 'Schedule', {
schedule: ScheduleExpression.rate(Duration.minutes(60)),
target: new targets.FirehosePutRecord(deliveryStream, {
input: ScheduleTargetInput.fromObject(payload),
}),
});
Initializer
ts
new ScheduleExpression()
python
ScheduleExpression()
java
new ScheduleExpression()
csharp
new ScheduleExpression()
go
NewScheduleExpression()
Properties
expressionStringstringexpression_stringstrexpressionStringStringExpressionStringstringExpressionString*string#Retrieve the expression for this schedule.
Methods
at(date: date, timeZone?: TimeZone): ScheduleExpression // chainable@staticmethod def at(date: datetime, time_zone: typing.Optional[TimeZone] = None) -> ScheduleExpressionpublic static ScheduleExpression at(Instant date, TimeZone timeZone)public static ScheduleExpression At(DateTime date, TimeZone? timeZone = null)func At(Date *time.Time, TimeZone TimeZone) ScheduleExpressionstatic#Construct a one-time schedule from a date.
2 parameters
Parameters
datedatedatedateDate— The date and time to use.timeZonetime_zonetimeZonetimeZoneTimeZone— The time zone to use for interpreting the date.
cron(options: CronOptionsWithTimezone): ScheduleExpression // chainable@staticmethod def cron(options: CronOptionsWithTimezone) -> ScheduleExpressionpublic static ScheduleExpression cron(CronOptionsWithTimezone options)public static ScheduleExpression Cron(CronOptionsWithTimezone options)func Cron(Options CronOptionsWithTimezone) ScheduleExpressionstatic#Create a recurring schedule from a set of cron fields and time zone.
expression(expression: string, timeZone?: TimeZone): ScheduleExpression // chainable@staticmethod def expression(expression: str, time_zone: typing.Optional[TimeZone] = None) -> ScheduleExpressionpublic static ScheduleExpression expression(String expression, TimeZone timeZone)public static ScheduleExpression Expression(string expression, TimeZone? timeZone = null)func Expression(Expression *string, TimeZone TimeZone) ScheduleExpressionstatic#Construct a schedule from a literal schedule expression.
2 parameters
Parameters
expressionexpressionexpressionexpressionExpression— The expression to use.timeZonetime_zonetimeZonetimeZoneTimeZone— The time zone to use for interpreting the expression.
rate(duration: Duration): ScheduleExpression // chainable@staticmethod def rate(duration: Duration) -> ScheduleExpressionpublic static ScheduleExpression rate(Duration duration)public static ScheduleExpression Rate(Duration duration)func Rate(Duration Duration) ScheduleExpressionstatic#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.