Cron construct is a higher level CDK construct that makes it easy to create a cron job. You can create a cron job by handler function and specifying the schedule it needs to run on. Internally this construct uses a EventBridge Rule.
Allow the function to access S3.
Configure the internally created CDK
An instance of
Cron contains the following properties.
The internally created CDK EventBridge
The internally created
Function instance that'll be run on schedule.
An instance of
Queue contains the following methods.
Attaches the given list of permissions to the
jobFunction. This allows the function to access other AWS resources.
FunctionDefinition | CronJobProps, defaults to
string | cdk.Duration | cdk.aws-events.CronOptions
The schedule for the cron job. Can be specified as a string. The string format takes a rate expression.
Or as a cron expression.
You can also use the
cdk.Duration as an alternative to defining the rate expression.
Similarly, you can specify the cron expression using
cdk.aws-events.RuleProps, defaults to
Or optionally pass in a CDK EventBridge
RuleProps. This allows you to override the default settings this construct uses internally to create the events rule.
FunctionDefinition object that'll be used to create the job function for the cron.
cdk.aws-events-targets.LambdaFunctionProps, defaults to
Or optionally pass in a CDK
LambdaFunctionProps. This allows you to override the default settings this construct uses internally to create the job.