How to launch Glue Jobs from CloudFormation?

0

I modified this example from the AWS documentation to specify my Glue jobs, but nothing happens:

Resources:
ScheduledJobTrigger:
Type: AWS::Glue::Trigger
Properties:
Type: SCHEDULED
Description: DESCRIPTION_SCHEDULED
Schedule: cron(0 **/2 ** ** ? **)
Actions:
- JobName: prod-job2
- JobName: prod-job3
Arguments:
'--job-bookmark-option': job-bookmark-enable
Name: prod-trigger1-scheduled

This script is in a YAML file that I uploaded to CloudFormation. I used all the default settings after the import. After the specified cron time, nothing happens.

What else is needed to launch Glue jobs?

asked 4 years ago631 views
2 Answers
0

got answer from stackoverflow ...

answered 4 years ago
0

When CloudFormation creates a resource of type AWS::Glue::Trigger, it is in the Created state by default. To start jobs with the trigger, it needs to be in the Activated state. To put this resource in the Activated state on creation with CloudFormation, we can include the StartOnCreation property with a value of true in the resource definition. I have included an example below which triggers a job named Test every hour.

Resources:
  ScheduledJobTrigger:
    Type: AWS::Glue::Trigger
    Properties:
      Type: SCHEDULED
      Schedule: cron(0 * * * ? *)
      Actions:
        - JobName: Test
      StartOnCreation: true

Documentation for the StartOnCreation property can be found at the following link: https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-resource-glue-trigger.html#cfn-glue-trigger-startoncreation

The current status of your Glue Trigger can be found on the Glue Trigger console page.

Alternatively, the trigger can be activated from the Glue Trigger console page, or using the awscli:

aws glue start-trigger --name <trigger name>

Please add a reply if you need any other help with this topic.

AWS
answered 7 months ago

You are not logged in. Log in to post an answer.

A good answer clearly answers the question and provides constructive feedback and encourages professional growth in the question asker.

Guidelines for Answering Questions