# 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.

- Source: [`aws-scheduler/lib/schedule-expression.ts`](https://github.com/aws/aws-cdk/blob/v2.275.0/packages/aws-cdk-lib/aws-scheduler/lib/schedule-expression.ts#L14)
- Type last changed: v2.186.0 · 27 Mar 2025

## 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()
```

## Properties

- `expressionString`: string — Retrieve the expression for this schedule.

- `timeZone`: [TimeZone](/cdk/api/v2/docs/aws-cdk-lib.TimeZone.html) — Retrieve the expression for this schedule.

## Methods

- `at(date: date, timeZone?: TimeZone): ScheduleExpression // chainable` (static) — Construct a one-time schedule from a date.

  **Parameters**

  - `date` — The date and time to use.
  - `timeZone` — The time zone to use for interpreting the date.

- `cron(options: CronOptionsWithTimezone): ScheduleExpression // chainable` (static) — Create a recurring schedule from a set of cron fields and time zone.

- `expression(expression: string, timeZone?: TimeZone): ScheduleExpression // chainable` (static) — Construct a schedule from a literal schedule expression.

  **Parameters**

  - `expression` — The expression to use.
  - `timeZone` — The time zone to use for interpreting the expression.

- `rate(duration: Duration): ScheduleExpression // chainable` (static) — 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.
