Skip to content

Instantly share code, notes, and snippets.

@jitsejan
Created August 9, 2019 10:25
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 1 You must be signed in to fork a gist
  • Save jitsejan/b7c5f29c47a3a50acccd4ff3b770f24b to your computer and use it in GitHub Desktop.
Save jitsejan/b7c5f29c47a3a50acccd4ff3b770f24b to your computer and use it in GitHub Desktop.
Trigger AWS Glue job
import boto3
ENV = "dev"
ETL_GLUE_JOB = "my-glue-job"
REGION = "eu-west-1"
session = boto3.session.Session(profile_name=ENV)
glue = session.client('glue', REGION)
def trigger_glue(file_path):
response = glue.start_job_run(JobName=ETL_GLUE_JOB,
Arguments={'--file_path': file_path,
'--env': ENV,
'--region': REGION}
)
return response
response = trigger_glue("/parse/this/path")
print(response)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment