1

This is the doc: https://docs.aws.amazon.com/glue/latest/dg/aws-glue-api-jobs-runs.html#aws-glue-api-jobs-runs-StartJobRun

I have a stepfunction, I want to use it to trigger an existing Glue job and run it, should I use startjobrun or getjobrun? My Glue job is created by Terraform, I've tried this (see this question: Glue job succeeded without StepFunction, but failed if it's kicked off by StepFunction) I used "Resource": "arn:aws:states:::glue:startJobRun.sync", in stepfunction but the glue job will fail.

My question is for my case, since I've already have my glue job created, should I use "Resource": "arn:aws:states:::glue:getJobRun.sync", in the step function? If so, how can I pass the runId ?(https://docs.aws.amazon.com/glue/latest/dg/aws-glue-api-jobs-runs.html#aws-glue-api-jobs-runs-GetJobRun)

RunId – Required: UTF-8 string, not less than 1 or more than 255 bytes long, matching the Single-line string pattern.
The ID of the job run.
wawawa
  • 2,835
  • 6
  • 44
  • 105

1 Answers1

0

Yes. we need to use resource arn:aws:states:::glue:startJobRun.sync to start the glue job from step function task and we don't need to pass runId. For glue start-job-run runId is only required for retry.

 {
         "Type":"Task",
         "Resource":"arn:aws:states:::glue:startJobRun.sync",
         "Parameters":{
            "JobName":"my-glue-job",
            "Timeout":60,
            "NotificationProperty":{
               "NotifyDelayAfter":30
            }
         }
      }

And get-job-run is only to get metadata of a previous execution of a job.

Douglas Figueroa
  • 675
  • 6
  • 17
Balu Vyamajala
  • 9,287
  • 1
  • 20
  • 42