# Schedule

Schedule for scheduled scaling actions.

- Source: [`aws-applicationautoscaling/lib/schedule.ts`](https://github.com/aws/aws-cdk/blob/v2.275.0/packages/aws-cdk-lib/aws-applicationautoscaling/lib/schedule.ts#L10)
- Type last changed: v2.97.1 · 26 Sep 2023

## Example

```ts
import { TimeZone } from 'aws-cdk-lib';
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,
  timeZone: TimeZone.AMERICA_DENVER,
});

capacity.scaleOnSchedule('AllowDownscalingAtNight', {
  schedule: appscaling.Schedule.cron({ hour: '20', minute: '0' }),
  minCapacity: 1,
  timeZone: TimeZone.AMERICA_DENVER,
});
```

## Initializer

```ts
new Schedule()
```

## Properties

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

## Methods

- `at(moment: date): Schedule // chainable` (static) — Construct a Schedule from a moment in time.

- `cron(options: CronOptions): Schedule // chainable` (static) — Create a schedule from a set of cron fields.

- `expression(expression: string): Schedule // chainable` (static) — Construct a schedule from a literal schedule expression.

  **Parameters**

  - `expression` — The expression to use.

- `rate(duration: Duration): Schedule // chainable` (static) — Construct a schedule from an interval and a time unit.
