From c9a7ba1d75fcd4b98e618baf558a566b789df209 Mon Sep 17 00:00:00 2001 From: Jo Date: Mon, 1 Apr 2024 09:16:41 -0400 Subject: [PATCH] added production backend-service & fixed image name in backend-service --- .github/workflows/verify-backend.yaml | 2 +- .../services/backend-service/terragrunt.hcl | 54 +++++++++++++++++++ 2 files changed, 55 insertions(+), 1 deletion(-) create mode 100644 tofu/environments/production/services/backend-service/terragrunt.hcl diff --git a/.github/workflows/verify-backend.yaml b/.github/workflows/verify-backend.yaml index ebbb8b3a7..e8f28488d 100644 --- a/.github/workflows/verify-backend.yaml +++ b/.github/workflows/verify-backend.yaml @@ -70,5 +70,5 @@ jobs: run: | terragrunt init terragrunt validate - terragrunt plan -var 'image=$IMAGE' + terragrunt plan -var 'image=${{env.IMAGE}}' diff --git a/tofu/environments/production/services/backend-service/terragrunt.hcl b/tofu/environments/production/services/backend-service/terragrunt.hcl new file mode 100644 index 000000000..76d583483 --- /dev/null +++ b/tofu/environments/production/services/backend-service/terragrunt.hcl @@ -0,0 +1,54 @@ +include "root" { + path = find_in_parent_folders() + expose = true +} + +include "env" { + path = find_in_parent_folders("environment.hcl") + expose = true +} + +terraform { + source = "../../../../modules/services/backend-service" +} + +dependency "vpc" { + config_path = "../../network/vpc" + + mock_outputs_allowed_terraform_commands = ["validate"] + mock_outputs = { + private_subnets = ["subnet-mocksubnet1234567"] + } +} + +dependency "backend-infra" { + config_path = "../backend-infra" + + mock_outputs_allowed_terraform_commands = ["validate"] + mock_outputs = { + target_group_key = "MOCK_KEY" + log_group = "MOCK_LOGS" + ecs_cluster = "MOCK_CLUSTER_ID" + security_group = "MOCK_SG" + } +} + +locals { + environment = include.env.locals.environment + name_prefix = "tb-${include.root.locals.short_name}-${include.env.locals.environment}" + region = include.env.locals.region + project_tags = include.root.locals.tags + environment_tags = include.env.locals.tags + tags = "${merge(local.project_tags, local.environment_tags)}" +} + +inputs = { + name_prefix = local.name_prefix + region = local.region + subnets = dependency.vpc.outputs.private_subnets + log_group = dependency.backend-infra.outputs.log_group + target_group_arn = dependency.backend-infra.outputs.target_group_arn + security_group = dependency.backend-infra.outputs.security_group_id + ecs_cluster = dependency.backend-infra.outputs.cluster_id + tags = local.tags +} \ No newline at end of file