0e6ecae26d
Rename all acdl-* AWS resources → nova-* across terraform (DynamoDB, Secrets Manager, Lambda, SNS, SG, KMS alias, ECS, ECR, IAM user/policy, state bucket, ALB, VPC/subnet names). Lambda default table names → nova-* (D-111). State bucket backend → nova-tfstate (-migrate-state documented). New docs/NOVA_AWS_MIGRATION.md runbook (staged migration + rollback). New scripts/migrate_dynamodb_data.py (scan+copy, dry-run default). acdl-deploy- → nova-deploy- role ARN in deploy workflows. Test fixtures updated; terraform validate + pytest + run_ci.sh PASS. ---ci--- project: acdl phase: 4 milestone: v1.15 status: execute ---/ci---
52 lines
1.3 KiB
Terraform
52 lines
1.3 KiB
Terraform
resource "aws_wafv2_web_acl" "this" {
|
|
name = var.name
|
|
scope = local.scope
|
|
|
|
default_action {
|
|
dynamic "allow" {
|
|
for_each = local.action_type == "allow" ? [1] : []
|
|
content {}
|
|
}
|
|
dynamic "block" {
|
|
for_each = local.action_type == "block" ? [1] : []
|
|
content {}
|
|
}
|
|
}
|
|
|
|
visibility_config {
|
|
cloudwatch_metrics_enabled = true
|
|
metric_name = "nova-waf-metrics"
|
|
sampled_requests_enabled = true
|
|
}
|
|
|
|
dynamic "rule" {
|
|
for_each = var.rules
|
|
content {
|
|
name = lookup(rule.value, "name", "custom-rule-${rule.key}")
|
|
priority = lookup(rule.value, "priority", rule.key)
|
|
override_action {
|
|
none {}
|
|
}
|
|
statement {
|
|
byte_match_statement {
|
|
search_string = lookup(rule.value, "search_string", "/")
|
|
positional_constraint = "CONTAINS"
|
|
field_to_match {
|
|
single_header {
|
|
name = "user-agent"
|
|
}
|
|
}
|
|
text_transformation {
|
|
priority = 0
|
|
type = "NONE"
|
|
}
|
|
}
|
|
}
|
|
visibility_config {
|
|
cloudwatch_metrics_enabled = true
|
|
metric_name = "${lookup(rule.value, "name", "custom-rule-${rule.key}")}-metrics"
|
|
sampled_requests_enabled = true
|
|
}
|
|
}
|
|
}
|
|
} |