Skip to content

Commit 488c772

Browse files
committed
feat: waf 로그 그룹 추가
1 parent 14aa0e8 commit 488c772

File tree

1 file changed

+12
-0
lines changed

1 file changed

+12
-0
lines changed

terraform/common/main.tf

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -63,3 +63,15 @@ resource "aws_wafv2_web_acl_association" "this" {
6363
resource_arn = module.alb.alb_arn
6464
web_acl_arn = module.waf.web_acl_arn
6565
}
66+
67+
resource "aws_cloudwatch_log_group" "waf_logs" {
68+
name = "aws-waf-logs-${local.project_name}"
69+
retention_in_days = 7
70+
71+
tags = local.common_tags
72+
}
73+
74+
resource "aws_wafv2_web_acl_logging_configuration" "this" {
75+
log_destination_configs = [trimsuffix(aws_cloudwatch_log_group.waf_logs.arn, ":*")]
76+
resource_arn = module.waf.web_acl_arn
77+
}

0 commit comments

Comments
 (0)