I am trying to build a lambda function which execute a Glue job:
import json
import boto3
def lambda_handler(event, context):
client = boto3.client('glue')
response = client.start_job_run(
JobName = 'job1',
Arguments = {
'--parametro1': 'par 1'} )
return {
'statusCode': 200,
'body': json.dumps('Hello from Lambda!')
}
The lambda1 does not wait for the job execution finishes, it only execute the job and finishes.
I would like the lambda handles the result of job execution, because the lambda is executed from a step function, which only if the lambda finishes successfully, the step function goes to the next step.