CronOptions
- class aws_cdk.aws_events.CronOptions(*, day=None, hour=None, minute=None, month=None, week_day=None, year=None)
Bases:
object
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.
- Parameters:
day (
Optional
[str
]) – The day of the month to run this rule at. Default: - Every day of the monthhour (
Optional
[str
]) – The hour to run this rule at. Default: - Every hourminute (
Optional
[str
]) – The minute to run this rule at. Default: - Every minutemonth (
Optional
[str
]) – The month to run this rule at. Default: - Every monthweek_day (
Optional
[str
]) – The day of the week to run this rule at. Default: - Any day of the weekyear (
Optional
[str
]) – The year to run this rule at. Default: - Every year
- See:
- ExampleMetadata:
infused
Example:
import aws_cdk.aws_events as events import aws_cdk.aws_events_targets as targets # fn: lambda.Function rule = events.Rule(self, "Schedule Rule", schedule=events.Schedule.cron(minute="0", hour="4") ) rule.add_target(targets.LambdaFunction(fn))
Attributes
- day
The day of the month to run this rule at.
- Default:
Every day of the month
- hour
The hour to run this rule at.
- Default:
Every hour
- minute
The minute to run this rule at.
- Default:
Every minute
- month
The month to run this rule at.
- Default:
Every month
- week_day
The day of the week to run this rule at.
- Default:
Any day of the week
- year
The year to run this rule at.
- Default:
Every year