TriggerSchedule
- class aws_cdk.aws_glue.TriggerSchedule(*args: Any, **kwargs)
Bases:
objectRepresents a trigger schedule.
- ExampleMetadata:
infused
Example:
import aws_cdk as cdk import aws_cdk.aws_iam as iam # stack: cdk.Stack # role: iam.IRole # script: glue.Code job = glue.PySparkEtlJob(stack, "Job", role=role, script=script) workflow = glue.Workflow(stack, "Workflow") workflow.add_scheduled_trigger("WeeklyTrigger", actions=[glue.Action.job(job)], schedule=glue.TriggerSchedule.weekly() )
Attributes
- expression_string
The expression string for the schedule.
Static Methods
- classmethod cron(*, day=None, hour=None, minute=None, month=None, week_day=None, year=None)
Creates a new TriggerSchedule instance with a cron expression.
- 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
- Return type:
- Returns:
A new TriggerSchedule instance.
- classmethod daily()
Creates a schedule that fires once a day, at midnight UTC.
- Return type:
- Returns:
A new TriggerSchedule instance.
- classmethod expression(expression)
Creates a new TriggerSchedule instance with a custom expression.
- Parameters:
expression (
str) – The custom expression for the schedule.- Return type:
- Returns:
A new TriggerSchedule instance.
- classmethod weekly()
Creates a schedule that fires once a week, at midnight UTC on Sunday.
- Return type:
- Returns:
A new TriggerSchedule instance.