Created
August 9, 2019 10:25
-
-
Save jitsejan/b7c5f29c47a3a50acccd4ff3b770f24b to your computer and use it in GitHub Desktop.
Trigger AWS Glue job
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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