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?

preguntada hace 4 años632 visualizaciones
2 Respuestas
0

got answer from stackoverflow ...

respondido hace 4 años
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
respondido hace 7 meses

No has iniciado sesión. Iniciar sesión para publicar una respuesta.

Una buena respuesta responde claramente a la pregunta, proporciona comentarios constructivos y fomenta el crecimiento profesional en la persona que hace la pregunta.

Pautas para responder preguntas