Files
acdl/modules/l1/waf
Jon Chery 0ca383dae6 feat(P4): transparent terraform + feature flags + run_platform.sh split (REQ-233..238)
Create run_codegen.sh (pre-TF: env check, validate, resolve, adapt).
Create run_postapply.sh (post-TF: Checkov, confidence, HITL, outbox, SSM, uptime).
Add variable 'enabled' (bool, default true) + count=var.enabled?1:0 to all 12
L1 modules (alb, cloudfront, ecr, ecs-cluster, ecs-service, iam-role, kms-key,
rds, s3, uptime, vpc, waf). Fix all cross-resource references with [0] indexing.
Update interface.json for all modules to declare 'enabled' input.
Fix stale artifact path /tmp/acdl_platform_run_v18 → /tmp/nova_platform_run (REQ-238).
run_platform.sh remains as backward-compat shim for local-dev usage.

---ci---
project: acdl
phase: 4
milestone: v1.20
status: execute
requirements: [REQ-233, REQ-234, REQ-235, REQ-236, REQ-237, REQ-238]
---/ci---
2026-08-07 18:49:56 +00:00
..

waf — WAFv2 Web ACL

Module kind: primitive | Version: 1.0.0

A WAFv2 Web ACL scoped to CloudFront. It applies managed rule groups by default and can be associated with a CloudFront distribution to filter traffic before it reaches the origin. CloudFront-scoped Web ACLs are always created in us-east-1.

Resources

Resource Type Purpose
webacl aws_wafv2_web_acl WAFv2 Web ACL with managed rules

Inputs

Name Type Required Default Description
name string yes Name of the Web ACL
scope string no cloudfront Scope of the Web ACL (default cloudfront for CloudFront associations)
default_action string no allow Default action (default allow)
rules string no Optional custom rules as JSON (default: managed rules only)
region string yes AWS region (CloudFront-scoped WAF is always us-east-1; the adapter ignores this for cloudfront scope)

Outputs

Name Type Description
web_acl_arn arn The WAF Web ACL ARN

Usage

{
  "id": "waf",
  "type": "aws:wafv2:webacl",
  "module": "waf@1.0.0",
  "inputs": {
    "name": "acdl-static-assets-waf",
    "scope": "cloudfront",
    "default_action": "allow",
    "region": "us-east-1"
  }
}

The web_acl_arn output is typically wired as a ref: expression into the cloudfront primitive's waf_web_acl_arn input inside a module composition (see modules/l2/static-assets).

Compliance extension points

  • Rate limiting — add a rate-based rule to cap requests per IP (SOC2 CC6.1, DORA operational resilience).
  • Geo blocking — add a geo-match statement to block/allow countries for data-residency compliance (GDPR Art.44, SOC2 CC6.1).
  • Custom rules — add custom rule statements for application-specific filtering (e.g. block SQLi/IP allow-lists) (SOC2 CC6.1).
  • Logging — enable WAF access logging to S3/CloudWatch/Kinesis for auditability (SOC2 CC7.2, DORA audit trail).

Examples

Validated example contracts are in examples/. The platform-test pipeline validates them against schemas/contract.schema.json.

Simple

A minimal deployment:

examples/simple.yml

environment: dev
id: waf
infrastructure:
  waf:
    inputs:
      name: my-waf
      region: us-east-1
    version: 1.0.0
name: waf-firewall

Complex

A production deployment with optional inputs:

examples/complex.yml

environment: dev
id: waf
infrastructure:
  waf:
    inputs:
      default_action: allow
      name: my-production-waf
      region: us-east-1
      scope: cloudfront
    version: 1.0.0
name: waf-firewall

Versioning

1.0.0 — interface MAJOR, behavior MINOR, lifecycle PATCH. MAJOR bumps require a new registry entry (immutable publication); old entries enter a 12-month deprecation window.