Need to pass variable from one glue job to another via event bridge using stepfunction

30 views Asked by At

What is the correct way to pass the parameter from the glue job to another via event bridge trigger in stepfunction?

The format of stepfunction is

{
"comment":"This is a step function",
"startat":"parallel",
"states":{
"Type":"parallel",
"ResultsPath":"$.parallelResults",
"Branches":[
{
"startAt":"Glue Job start servicenow table incident",
"states":{
"type":"Task",
"Resource":"arn:aws:states:::gluejob:startJobRun.sync",
"Parameters":{
"Jobname":"glue job name",
"Arguments":{
      "--market.$":"$.market",
      "--dates.$":"$.dates",
}
},
"End":True

}
}
#----runs for other table in parallel  ----
]

},
"Eventbridge PutEvent":{
"type":"Task",
"Resource":"arn:aws:states:::gluejob:startJobRun.sync",
"Parameters":{
"Entries":{
"Details" :{"My Message":"{\"market\":null,\"dates:" **Need to pass dates form arguments from above parallel job into the event bridge job** "}
}
}

}

Here I need to pass the dates into the details message so the eventbridge will trigger the sns with this message

dates contains a dictonary in string format Ex: dates:"{"to_date":"2024-01-02 00:00:00","from_date":"2024-01-01 00:00:00"}" this need to be passed to details in message to other glue job.

how can it be passed?

Tried using the$.parallelresults[0].output.arguments[--dates] but it is not working

We are getting the parameter as None in the next glue job trigger

0

There are 0 answers