Skip to content

Commit

Permalink
Fix btch sg refs
Browse files Browse the repository at this point in the history
  • Loading branch information
dmannarino committed Aug 27, 2024
1 parent d984f37 commit 22e397c
Showing 1 changed file with 11 additions and 10 deletions.
21 changes: 11 additions & 10 deletions terraform/main.tf
Original file line number Diff line number Diff line change
Expand Up @@ -32,15 +32,15 @@ locals {

# Docker image for FastAPI app
module "app_docker_image" {
source = "git::https://github.com/wri/gfw-terraform-modules.git//terraform/modules/container_registry?ref=v0.4.2.6-alpha4"
source = "git::https://github.com/wri/gfw-terraform-modules.git//terraform/modules/container_registry?ref=v0.4.2.6-alpha5"
image_name = substr(lower("${local.project}${local.name_suffix}"), 0, 64)
root_dir = "${path.root}/../"
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.6-alpha4"
source = "git::https://github.com/wri/gfw-terraform-modules.git//terraform/modules/container_registry?ref=v0.4.2.6-alpha5"
image_name = substr(lower("${local.project}-gdal_python${local.name_suffix}"), 0, 64)
root_dir = "${path.root}/../"
docker_path = "batch"
Expand All @@ -49,7 +49,7 @@ module "batch_gdal_python_image" {

# 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.6-alpha4"
source = "git::https://github.com/wri/gfw-terraform-modules.git//terraform/modules/container_registry?ref=v0.4.2.6-alpha5"
image_name = substr(lower("${local.project}-pixetl${local.name_suffix}"), 0, 64)
root_dir = "${path.root}/../"
docker_path = "batch"
Expand All @@ -58,7 +58,7 @@ module "batch_pixetl_image" {

# Docker image for PostgreSQL Client Batch jobs
module "batch_postgresql_client_image" {
source = "git::https://github.com/wri/gfw-terraform-modules.git//terraform/modules/container_registry?ref=v0.4.2.6-alpha4"
source = "git::https://github.com/wri/gfw-terraform-modules.git//terraform/modules/container_registry?ref=v0.4.2.6-alpha5"
image_name = substr(lower("${local.project}-postgresql_client${local.name_suffix}"), 0, 64)
root_dir = "${path.root}/../"
docker_path = "batch"
Expand All @@ -67,7 +67,7 @@ module "batch_postgresql_client_image" {

# 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.6-alpha4"
source = "git::https://github.com/wri/gfw-terraform-modules.git//terraform/modules/container_registry?ref=v0.4.2.6-alpha5"
image_name = substr(lower("${local.project}-tile_cache${local.name_suffix}"), 0, 64)
root_dir = "${path.root}/../"
docker_path = "batch"
Expand All @@ -76,7 +76,7 @@ module "batch_tile_cache_image" {


module "fargate_autoscaling" {
source = "git::https://github.com/wri/gfw-terraform-modules.git//terraform/modules/fargate_autoscaling?ref=v0.4.2.6-alpha4"
source = "git::https://github.com/wri/gfw-terraform-modules.git//terraform/modules/fargate_autoscaling?ref=v0.4.2.6-alpha5"
project = local.project
name_suffix = local.name_suffix
tags = local.fargate_tags
Expand All @@ -98,6 +98,7 @@ module "fargate_autoscaling" {
// acm_certificate_arn = var.environment == "dev" ? null : data.terraform_remote_state.core.outputs.acm_certificate
security_group_ids = [
data.terraform_remote_state.core.outputs.postgresql_security_group_id,
module.fargate_autoscaling.ecs_security_group_id
]
task_role_policies = [
data.terraform_remote_state.core.outputs.iam_policy_s3_write_data-lake_arn,
Expand All @@ -123,7 +124,7 @@ module "fargate_autoscaling" {

# Using instance types with 1 core only
module "batch_aurora_writer" {
source = "git::https://github.com/wri/gfw-terraform-modules.git//terraform/modules/compute_environment?ref=v0.4.2.6-alpha4"
source = "git::https://github.com/wri/gfw-terraform-modules.git//terraform/modules/compute_environment?ref=v0.4.2.6-alpha5"
ecs_role_policy_arns = [
data.terraform_remote_state.core.outputs.iam_policy_s3_write_data-lake_arn,
data.terraform_remote_state.core.outputs.secrets_postgresql-reader_policy_arn,
Expand All @@ -143,7 +144,7 @@ module "batch_aurora_writer" {
security_group_ids = [
data.terraform_remote_state.core.outputs.default_security_group_id,
data.terraform_remote_state.core.outputs.postgresql_security_group_id,
data.terraform_remote_state.core.outputs.batch_security_group_id
module.fargate_autoscaling.batch_security_group_id
]
subnets = data.terraform_remote_state.core.outputs.private_subnet_ids
suffix = local.name_suffix
Expand All @@ -155,7 +156,7 @@ module "batch_aurora_writer" {


module "batch_data_lake_writer" {
source = "git::https://github.com/wri/gfw-terraform-modules.git//terraform/modules/compute_environment?ref=v0.4.2.6-alpha4"
source = "git::https://github.com/wri/gfw-terraform-modules.git//terraform/modules/compute_environment?ref=v0.4.2.6-alpha5"
ecs_role_policy_arns = [
aws_iam_policy.query_batch_jobs.arn,
aws_iam_policy.s3_read_only.arn,
Expand All @@ -171,7 +172,7 @@ module "batch_data_lake_writer" {
security_group_ids = [
data.terraform_remote_state.core.outputs.default_security_group_id,
data.terraform_remote_state.core.outputs.postgresql_security_group_id,
data.terraform_remote_state.core.outputs.batch_security_group_id
module.fargate_autoscaling.batch_security_group_id
]
subnets = data.terraform_remote_state.core.outputs.private_subnet_ids
suffix = local.name_suffix
Expand Down

0 comments on commit 22e397c

Please sign in to comment.