🖥
AWS Terraform - WAF で基本はアクセスをブロック、指定のIPアドレスだけを許可する例
例
resource "aws_wafv2_web_acl" "example" {
name = "example-waf-acl-name"
scope = "REGIONAL"
default_action {
block {}
}
# 設定はてきとう
visibility_config {
cloudwatch_metrics_enabled = false
metric_name = "example-waf-metric"
sampled_requests_enabled = false
}
rule {
name = "allow-ips-list"
priority = 1
action {
allow {
}
}
statement {
or_statement {
statement {
ip_set_reference_statement {
arn = <WAFのIPセットのARN>
}
}
statement {
ip_set_reference_statement {
arn = <WAFのIPセットのARN>
}
}
}
}
# 設定はてきとう
visibility_config {
cloudwatch_metrics_enabled = false
metric_name = "example-waf-rule-metric"
sampled_requests_enabled = false
}
}
}
参考
チャットメンバー募集
何か質問、悩み事、相談などあればLINEオープンチャットもご利用ください。
プロフィール・経歴
公開日時
2025-03-28
Discussion