Skip to content

Commit

Permalink
Only build one image in TF, instead of 3
Browse files Browse the repository at this point in the history
  • Loading branch information
dmannarino committed Dec 16, 2024
1 parent b864ec3 commit f57c827
Showing 1 changed file with 6 additions and 25 deletions.
31 changes: 6 additions & 25 deletions terraform/main.tf
Original file line number Diff line number Diff line change
Expand Up @@ -44,15 +44,6 @@ module "app_docker_image" {
tag = local.container_tag
}

# Docker image for GDAL Python Batch jobs
module "batch_gdal_python_image" {
source = "git::https://github.com/wri/gfw-terraform-modules.git//terraform/modules/container_registry?ref=v0.4.2.3"
image_name = substr(lower("${local.project}-gdal_python${local.name_suffix}"), 0, 64)
root_dir = "${path.root}/../"
docker_path = "batch"
docker_filename = "universal_batch.dockerfile"
}

# Docker image for PixETL Batch jobs
module "batch_pixetl_image" {
source = "git::https://github.com/wri/gfw-terraform-modules.git//terraform/modules/container_registry?ref=v0.4.2.3"
Expand All @@ -62,25 +53,15 @@ module "batch_pixetl_image" {
docker_filename = "pixetl.dockerfile"
}

# Docker image for PostgreSQL Client Batch jobs
module "batch_postgresql_client_image" {
# Docker image for all Batch jobs except those requiring PixETL
module "batch_universal_image" {
source = "git::https://github.com/wri/gfw-terraform-modules.git//terraform/modules/container_registry?ref=v0.4.2.3"
image_name = substr(lower("${local.project}-postgresql_client${local.name_suffix}"), 0, 64)
image_name = substr(lower("${local.project}-universal${local.name_suffix}"), 0, 64)
root_dir = "${path.root}/../"
docker_path = "batch"
docker_filename = "universal_batch.dockerfile"
}

# Docker image for Tile Cache Batch jobs
module "batch_tile_cache_image" {
source = "git::https://github.com/wri/gfw-terraform-modules.git//terraform/modules/container_registry?ref=v0.4.2.3"
image_name = substr(lower("${local.project}-tile_cache${local.name_suffix}"), 0, 64)
root_dir = "${path.root}/../"
docker_path = "batch"
docker_filename = "universal_batch.dockerfile"
}


module "fargate_autoscaling" {
source = "git::https://github.com/wri/gfw-terraform-modules.git//terraform/modules/fargate_autoscaling?ref=v0.4.2.5"
project = local.project
Expand Down Expand Up @@ -221,10 +202,10 @@ module "batch_job_queues" {
environment = var.environment
name_suffix = local.name_suffix
project = local.project
gdal_repository_url = "${module.batch_gdal_python_image.repository_url}:latest"
gdal_repository_url = "${module.batch_universal_image.repository_url}:latest"
pixetl_repository_url = "${module.batch_pixetl_image.repository_url}:latest"
postgres_repository_url = "${module.batch_postgresql_client_image.repository_url}:latest"
tile_cache_repository_url = "${module.batch_tile_cache_image.repository_url}:latest"
postgres_repository_url = "${module.batch_universal_image.repository_url}:latest"
tile_cache_repository_url = "${module.batch_universal_image.repository_url}:latest"
iam_policy_arn = [
"arn:aws:iam::aws:policy/AmazonS3ReadOnlyAccess",
aws_iam_policy.query_batch_jobs.arn,
Expand Down

0 comments on commit f57c827

Please sign in to comment.