Skip to content

Commit

Permalink
Fix waf sync local var name
Browse files Browse the repository at this point in the history
  • Loading branch information
carlpartridge committed Dec 30, 2024
1 parent d3ae54d commit 6258b89
Showing 1 changed file with 6 additions and 5 deletions.
11 changes: 6 additions & 5 deletions terraform/services/api-waf-sync/main.tf
Original file line number Diff line number Diff line change
@@ -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" {
Expand Down Expand Up @@ -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" {
Expand Down

0 comments on commit 6258b89

Please # to comment.