Skip to content

Commit dff38ec

Browse files
committed
Fixing name
1 parent d72d8c7 commit dff38ec

File tree

1 file changed

+7
-2
lines changed
  • operations/deployment/terraform/modules/aws/waf

1 file changed

+7
-2
lines changed

operations/deployment/terraform/modules/aws/waf/aws_waf.tf

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -375,6 +375,10 @@ resource "aws_wafv2_web_acl_association" "waf_association" {
375375
resource_arn = var.aws_lb_resource_arn
376376
web_acl_arn = aws_wafv2_web_acl.waf[0].arn
377377
}
378+
resource "aws_wafv2_web_acl_logging_configuration" "example" {
379+
log_destination_configs = [aws_cloudwatch_log_group.example.arn]
380+
resource_arn = aws_wafv2_web_acl.example.arn
381+
}
378382

379383
# WAF Logging Configuration (optional)
380384
resource "aws_wafv2_web_acl_logging_configuration" "waf_logging" {
@@ -393,16 +397,17 @@ resource "aws_wafv2_web_acl_logging_configuration" "waf_logging" {
393397
name = "cookie"
394398
}
395399
}
400+
depends_on = [ aws_cloudwatch_log_group.waf_log_group, aws_wafv2_web_acl.waf ]
396401
}
397402

398403
# CloudWatch Log Group for WAF (optional)
399404
resource "aws_cloudwatch_log_group" "waf_log_group" {
400405
count = var.aws_waf_enable && var.aws_waf_logging_enable ? 1 : 0
401-
name = "/aws/wafv2/${var.aws_resource_identifier}"
406+
name = "aws-waf-logs-${var.aws_resource_identifier}"
402407
retention_in_days = var.aws_waf_log_retention_days
403408

404409
tags = {
405-
Name = "${var.aws_resource_identifier}-waf-logs"
410+
Name = "aws-waf-logs-${var.aws_resource_identifier}"
406411
}
407412
}
408413

0 commit comments

Comments
 (0)