amazon-web-servicesaws-cloudformationaws-glue

CloudFormation: a way to define an ACTIVATED scheduled Glue job trigger


I'm using CloudFormation to define a SCHEDULED Glue job trigger according to the official documentation:

ParquetJobTrigger:
  Type: 'AWS::Glue::Trigger'
  Properties:
    Name: !Sub "${Prefix}_csv_to_parquet_job_trigger_${StageName}"
    Type: SCHEDULED
    Schedule: cron(0 0/1 * * ? *)
    Actions:
      - JobName: !Ref ParquetJob
        Arguments:
          "--job-bookmark-option": "job-bookmark-enable"

It works like a charm except one thing. It defines a job trigger that has a status CREATED and I have to manually enable it:

enter image description here

Is there a way to define an activated scheduled trigger alone via CloudFormation?


Solution

  • For anyone new looking, this can be achieved now by using the StartOnCreation property for new triggers.

    UEDDBJobTrigger:
      Type: AWS::Glue::Trigger
      Properties:
        Name: Foo
        Description: Scheduled trigger
        Type: SCHEDULED
        Schedule: "cron(0 10 ? * MON-FRI *)"
        StartOnCreation: true
        Actions: 
          - JobName: !Ref TestJob