File tree Expand file tree Collapse file tree 1 file changed +7
-2
lines changed
operations/deployment/terraform/modules/aws/waf Expand file tree Collapse file tree 1 file changed +7
-2
lines changed Original file line number Diff line number Diff 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)
380384resource "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)
399404resource "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
You can’t perform that action at this time.
0 commit comments