From 6258b89c06391de09bb3bfa906f8b59b9fe20073 Mon Sep 17 00:00:00 2001 From: carlpartridge Date: Mon, 30 Dec 2024 16:37:02 -0500 Subject: [PATCH] Fix waf sync local var name --- terraform/services/api-waf-sync/main.tf | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-) diff --git a/terraform/services/api-waf-sync/main.tf b/terraform/services/api-waf-sync/main.tf index 184df82f..6194eb52 100644 --- a/terraform/services/api-waf-sync/main.tf +++ b/terraform/services/api-waf-sync/main.tf @@ -1,7 +1,9 @@ locals { - full_name = "${var.app}-${var.env}-api-waf-sync" - bcda_sg_name = "bcda-${var.env}-rds" - dpc_sg_name = "dpc-${var.env}-db" + full_name = "${var.app}-${var.env}-api-waf-sync" + db_sg_names = { + bcda = "bcda-${var.env}-rds" + dpc = "dpc-${var.env}-db" + } } module "api_waf_sync_function" { @@ -31,9 +33,8 @@ module "api_waf_sync_function" { } # Add a rule to the database security group to allow access from the function - data "aws_security_group" "db" { - name = "local.${var.app}_sg_name" + name = local.db_sg_names[var.app] } resource "aws_security_group_rule" "function_access" {