TriggerSchedule

class aws_cdk.aws_glue.TriggerSchedule(*args: Any, **kwargs)

Bases: object

Represents 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 month

  • hour (Optional[str]) – The hour to run this rule at. Default: - Every hour

  • minute (Optional[str]) – The minute to run this rule at. Default: - Every minute

  • month (Optional[str]) – The month to run this rule at. Default: - Every month

  • week_day (Optional[str]) – The day of the week to run this rule at. Default: - Any day of the week

  • year (Optional[str]) – The year to run this rule at. Default: - Every year

Return type:

TriggerSchedule

Returns:

A new TriggerSchedule instance.

classmethod daily()

Creates a schedule that fires once a day, at midnight UTC.

Return type:

TriggerSchedule

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:

TriggerSchedule

Returns:

A new TriggerSchedule instance.

classmethod weekly()

Creates a schedule that fires once a week, at midnight UTC on Sunday.

Return type:

TriggerSchedule

Returns:

A new TriggerSchedule instance.