@aws-cdk_aws-scheduler-alpha.ScheduleExpression

class ScheduleExpression ๐Ÿ”น

LanguageType name
.NETAmazon.CDK.AWS.Scheduler.Alpha.ScheduleExpression
Gogithub.com/aws/aws-cdk-go/awscdkscheduleralpha/v2#ScheduleExpression
Javasoftware.amazon.awscdk.services.scheduler.alpha.ScheduleExpression
Pythonaws_cdk.aws_scheduler_alpha.ScheduleExpression
TypeScript (source)@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

NameTypeDescription
expressionString๐Ÿ”นstringRetrieve the expression for this schedule.
timeZone?๐Ÿ”นTimeZoneRetrieve the expression for this schedule.

expressionString๐Ÿ”น

Type: string

Retrieve the expression for this schedule.


timeZone?๐Ÿ”น

Type: TimeZone (optional)

Retrieve the expression for this schedule.

Methods

NameDescription
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 TimeZone โ€” The time zone to use for interpreting the date.

Returns

  • ScheduleExpression

Construct a one-time schedule from a date.


static cron(options)๐Ÿ”น

public static cron(options: CronOptionsWithTimezone): ScheduleExpression

Parameters

  • options CronOptionsWithTimezone

Returns

  • ScheduleExpression

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 TimeZone โ€” The time zone to use for interpreting the expression.

Returns

  • ScheduleExpression

Construct a schedule from a literal schedule expression.


static rate(duration)๐Ÿ”น

public static rate(duration: Duration): ScheduleExpression

Parameters

  • duration Duration

Returns

  • ScheduleExpression

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.