Skip to content

Commit d51201f

Browse files
authored
Merge pull request #2072 from LBHackney-IT/llpg-jdbc-ingestion
Llpg jdbc ingestion
2 parents aa58f13 + 9438775 commit d51201f

File tree

2 files changed

+51
-1
lines changed

2 files changed

+51
-1
lines changed

terraform/config/prod.tfvars

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ stack = "Core"
1010
transit_gateway_availability_zones = ["eu-west-2a", "eu-west-2b", "eu-west-2c"]
1111
transit_gateway_cidr = "10.120.32.0/24"
1212
transit_gateway_private_subnets = ["10.120.32.0/26", "10.120.32.64/26", "10.120.32.128/26"]
13-
rds_instance_ids = ["addresses-api-db-production-emergency-temp"]
13+
rds_instance_ids = []
1414
qlik_server_instance_type = "m5.2xlarge"
1515
qlik_ssl_certificate_domain = "qliksense.hackney.gov.uk"
1616
redshift_public_ips = ["18.168.126.173"]

terraform/core/15-unrestricted-geolive-database-ingestion.tf

Lines changed: 50 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -247,3 +247,53 @@ module "housing_boundaries_geolive_ingestion_job" {
247247
table_prefix = null
248248
}
249249
}
250+
251+
module "llpg_geolive_database_ingestion" {
252+
count = local.is_live_environment ? 1 : 0
253+
tags = module.tags.values
254+
255+
source = "../modules/database-ingestion-via-jdbc-connection"
256+
257+
name = "geolive-llpg-schema"
258+
jdbc_connection_url = "jdbc:postgresql://geolive-db-prod.cjgyygrtgrhl.eu-west-2.rds.amazonaws.com:5432/geolive"
259+
jdbc_connection_description = "JDBC connection to Geolive PostgreSQL database, to access the llpg schema only"
260+
jdbc_connection_subnet = data.aws_subnet.network[local.instance_subnet_id]
261+
identifier_prefix = local.short_identifier_prefix
262+
database_secret_name = "database-credentials/geolive-llpg"
263+
schema_name = "llpg"
264+
job_schedule = "cron(1 1 ? * * *)"
265+
}
266+
267+
module "llpg_geolive_ingestion_job" {
268+
count = local.is_production_environment ? 1 : 0
269+
source = "../modules/aws-glue-job"
270+
is_live_environment = local.is_live_environment
271+
is_production_environment = local.is_production_environment
272+
273+
department = module.department_unrestricted
274+
job_name = "${local.short_identifier_prefix}geolive llpg tables ingestion"
275+
glue_version = "4.0"
276+
script_s3_object_key = aws_s3_object.ingest_database_tables_via_jdbc_connection.key
277+
spark_ui_output_storage_id = module.spark_ui_output_storage.bucket_id
278+
helper_module_key = aws_s3_object.helpers.key
279+
pydeequ_zip_key = aws_s3_object.pydeequ.key
280+
jdbc_connections = [module.llpg_geolive_database_ingestion[0].jdbc_connection_name]
281+
triggered_by_crawler = module.llpg_geolive_database_ingestion[0].crawler_name
282+
workflow_name = module.llpg_geolive_database_ingestion[0].workflow_name
283+
job_parameters = {
284+
"--s3_ingestion_bucket_target" = "s3://${module.raw_zone.bucket_id}/unrestricted/geolive/llpg/"
285+
"--s3_ingestion_details_target" = "s3://${module.raw_zone.bucket_id}/unrestricted/geolive/llpg/ingestion-details/"
286+
"--source_data_database" = module.llpg_geolive_database_ingestion[0].ingestion_database_name
287+
}
288+
crawler_details = {
289+
database_name = module.department_unrestricted.raw_zone_catalog_database_name
290+
s3_target_location = "s3://${module.raw_zone.bucket_id}/unrestricted/geolive/llpg/"
291+
configuration = jsonencode({
292+
Version = 1.0
293+
Grouping = {
294+
TableLevelConfiguration = 5
295+
}
296+
})
297+
table_prefix = null
298+
}
299+
}

0 commit comments

Comments
 (0)