Skip to content

Commit

Permalink
* update endpoint for localstack vs aws
Browse files Browse the repository at this point in the history
  • Loading branch information
ShadeWyrm committed Nov 27, 2024
1 parent cb93b7a commit 3f8cf66
Show file tree
Hide file tree
Showing 4 changed files with 8 additions and 2 deletions.
2 changes: 1 addition & 1 deletion aws/glue/crawlers.tf
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ resource "aws_glue_crawler" "forms_rds_data" {
security_configuration = aws_glue_security_configuration.encryption_at_rest.name

s3_target {
path = "s3://${var.datalake_bucket_name}/operations/aws/rds-usage-report"
path = "${var.s3_endpoint}${var.datalake_bucket_name}/operations/aws/rds-usage-report"
}

configuration = jsonencode(
Expand Down
5 changes: 5 additions & 0 deletions aws/glue/inputs.tf
Original file line number Diff line number Diff line change
Expand Up @@ -32,3 +32,8 @@ variable "etl_bucket_name" {
description = "The name of the ETL bucket"
type = string
}

variable "s3_endpoint" {
description = "The S3 endpoint"
type = string
}
2 changes: 1 addition & 1 deletion aws/glue/jobs.tf
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ resource "aws_glue_job" "rds_glue_job" {
name = "rds_glue_job"
role_arn = aws_iam_role.glue_etl.arn
command {
script_location = "s3://${aws_s3_object.glue_script.bucket}/${aws_s3_object.glue_script.key}"
script_location = "${var.s3_endpoint}${aws_s3_object.glue_script.bucket}/${aws_s3_object.glue_script.key}"
python_version = "3"
}
default_arguments = {
Expand Down
1 change: 1 addition & 0 deletions env/cloud/glue/terragrunt.hcl
Original file line number Diff line number Diff line change
Expand Up @@ -43,6 +43,7 @@ inputs = {
rds_db_user = local.env == "local" ? "localstack_postgres" : "postgres" # We cannot use `postgres` as a username in Localstack
rds_db_password = "chummy" # RDS database password used for local setup TODO: < this.
rds_cluster_endpoint = dependency.rds.outputs.rds_cluster_endpoint
s3_endpoint = local.env == "local" ? "http://127.0.0.1:4566" : "s3://"
}

include {
Expand Down

0 comments on commit 3f8cf66

Please sign in to comment.