From 7e3c5fbbe13ccdb4df5e93a608a206c9cd680c14 Mon Sep 17 00:00:00 2001 From: spypsy Date: Mon, 4 Dec 2023 19:25:17 +0000 Subject: [PATCH] fix: double slash in deployed faucet routes --- yarn-project/aztec-faucet/terraform/main.tf | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/yarn-project/aztec-faucet/terraform/main.tf b/yarn-project/aztec-faucet/terraform/main.tf index 1f84fc6f6f2..68b0bd5e291 100644 --- a/yarn-project/aztec-faucet/terraform/main.tf +++ b/yarn-project/aztec-faucet/terraform/main.tf @@ -34,6 +34,10 @@ data "terraform_remote_state" "aztec2_iac" { } } +locals { + api_prefix = var.API_PREFIX == "" ? "/${var.DEPLOY_TAG}/aztec-faucet" : "/${var.DEPLOY_TAG}/aztec-faucet/${var.API_PREFIX}" +} + resource "aws_cloudwatch_log_group" "aztec-faucet" { name = "/fargate/service/${var.DEPLOY_TAG}/aztec-faucet" @@ -114,7 +118,7 @@ resource "aws_ecs_task_definition" "aztec-faucet" { }, { "name": "API_PREFIX", - "value": "/${var.DEPLOY_TAG}/aztec-faucet/${var.API_PREFIX}" + "value": "${local.api_prefix}" }, { "name": "CHAIN_ID", @@ -188,7 +192,7 @@ resource "aws_alb_target_group" "aztec-faucet" { deregistration_delay = 5 health_check { - path = "/${var.DEPLOY_TAG}/aztec-faucet/${var.API_PREFIX}/status" + path = "${local.api_prefix}/status" matcher = "200" interval = 10 healthy_threshold = 2