Skip to content

Commit 90ab98c

Browse files
committed
NRL-1188 zip extra python files for use
1 parent a2502fc commit 90ab98c

File tree

2 files changed

+15
-1
lines changed
  • terraform/account-wide-infrastructure/modules/glue

2 files changed

+15
-1
lines changed

terraform/account-wide-infrastructure/modules/glue/glue.tf

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff 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

terraform/account-wide-infrastructure/modules/glue/s3.tf

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff 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+
}

0 commit comments

Comments
 (0)