I have been trying to orchestrate AWS Glue to read and write to S3 by Terraform.
After configuration in main.tf, the job needs manual trigger over UI or AWS CLI to get triggered.
Thank you
The Glue Job should run along by Terraform Script.
Tried to to add triggers in main.tf but did not work.
2
It doesn’t look like terraform allows to start a glue job natively. You will need to use something else to trigger it, like aws cli.
You can then run:
aws glue start-job-run --job-name example_job_2
If you really want this integrated with terraform then use local-exec resource:
resource "aws_glue_job" "Job_Glue" { name = "example_job_2" role_arn = "arn:aws:iam::123456789:role/service-role/AWSGlueServiceRole-crawl-mar" command { name = "Job 1" script_location = "s3://sample-csv/glue_pyspark.py" } provisioner "local-exec" { command = "aws glue start-job-run --job-name example_job_2" } }
You need to configure a glue trigger in main.tf
Click here to cancel reply.
2
Answers
It doesn’t look like terraform allows to start a glue job natively. You will need to use something else to trigger it, like aws cli.
You can then run:
If you really want this integrated with terraform then use local-exec resource:
You need to configure a glue trigger in main.tf