File tree Expand file tree Collapse file tree 2 files changed +15
-1
lines changed
terraform/account-wide-infrastructure/modules/glue Expand file tree Collapse file tree 2 files changed +15
-1
lines changed Original file line number Diff line number Diff line change @@ -42,7 +42,7 @@ resource "aws_glue_job" "glue_job" {
4242 command {
4343 name = " glueetl"
4444 python_version = var. python_version
45- script_location = " s3://${ aws_s3_bucket . code-bucket . id } /script .py"
45+ script_location = " s3://${ aws_s3_bucket . code-bucket . id } /main .py"
4646 }
4747
4848 default_arguments = {
@@ -54,6 +54,7 @@ resource "aws_glue_job" "glue_job" {
5454 " --job-name" = " poc-glue-job"
5555 " --enable-continuous-log-filter" = " true"
5656 " --enable-metrics" = " true"
57+ " --extra-py-files" = " s3://${ aws_s3_bucket . code-bucket . id } /src.zip"
5758 }
5859}
5960
Original file line number Diff line number Diff line change @@ -20,3 +20,16 @@ resource "aws_s3_bucket_object" "code-data-object" {
2020 source = " ${ path . module } /src/main.py"
2121 etag = filemd5 (" ${ path . module } /src/main.py" )
2222}
23+
24+ data "archive_file" "python" {
25+ type = " zip"
26+ output_path = " ${ path . module } /files/src.zip"
27+
28+ source_dir = " ${ path . module } /src"
29+ }
30+
31+ resource "aws_s3_bucket_object" "code-data-object" {
32+ bucket = aws_s3_bucket. code-bucket . bucket
33+ key = " main.py"
34+ source = data. archive_file . python
35+ }
You can’t perform that action at this time.
0 commit comments