CronOptions Struct
Options to configure a cron expression.
All fields are strings so you can use complex expressions. Absence of a field implies '*' or '?', whichever one is appropriate.
Example
ts
import * as events from 'aws-cdk-lib/aws-events';
import * as targets from 'aws-cdk-lib/aws-events-targets';
declare const fn: lambda.Function;
const rule = new events.Rule(this, 'Schedule Rule', {
schedule: events.Schedule.cron({ minute: '0', hour: '4' }),
});
rule.addTarget(new targets.LambdaFunction(fn));
Properties
The day of the month to run this rule at.
Default: Every day of the month
The minute to run this rule at.
Default: Every minute
The month to run this rule at.
Default: Every month
The day of the week to run this rule at.
Default: Any day of the week