DNS Firewall with Fail-Open Stated, Not Inherited
Domain lists, rule group, rules and VPC associations. Fail-open is an availability decision wearing a security name: closed makes a firewall fault a DNS outage, open resolves unfiltered without saying so. The module makes you choose.
Verification
Static-verifiedPassed: validated and lint-clean (provider-schema-validated for AWS/Azure/GCP; Terraform-language lint elsewhere).
Conformance
- Static validation (fmt · validate · tflint)
- Security scan clean (Checkov)
- Plan tests (mocked: validation rules · outputs)
Provenance
- SHA-256 checksum
- Signature (pending)
Functional
- Live test pending (no cloud run yet)
Last verified 2026-09-12 · how we verify
Use it from the registry
terraform · opentofumodule "dns_firewall" {
source = "www.iac-bazaar.com/iac-bazaar/aws-dns-firewall/aws"
version = "1.0.0"
}Needs a registry token from /account/tokens. The module itself is free; the account is what identifies you. Full setup: registry docs.
Inputs & outputs
Create a free account to read this module's contract
The declared contract - every input name, type, default and description, plus every output - is shown to signed-in accounts, not to anonymous visitors.
A free account sees the contract of every module in the catalogue. There is no subscription and nothing to buy - the modules are free to download, and they run under Vizier.
Documentation
aws-dns-firewall
A Route 53 Resolver DNS Firewall: domain lists, a rule group, its rules, and the
VPC associations that put it in the path. Works with Terraform and OpenTofu
(>= 1.6), AWS provider >= 6.0, < 7.0.
Fail-open is an availability decision wearing a security name, and it is the setting here worth thinking about twice.
fail_open = false(the default, and AWS's) fails a query the firewall cannot evaluate. Nothing unfiltered gets through - and a firewall problem becomes a DNS outage for every host in the VPCfail_open = trueresolves those queries unfiltered. The application keeps working and the control is not applied, without saying so
Neither is wrong. Choosing by accident is, which is why this module states it rather than inheriting it.
An ALERT rule is not a control. It logs the query and resolves it. That is
how you find out what a rule would break before you turn it on, and it is not
protection - the two look the same in the console, so the alert_only_rules
output lists them by name.
Other things it gets right that are easy to get wrong by hand:
example.comand*.example.comare two different entries. There is no leading-dot shorthand, and listing only the bare name leaves every subdomain resolving- Rule priorities are validated unique, in range, and the docs push you toward gaps - inserting between two adjacent priorities means renumbering the rest
mutation_protectionis on: rule groups get detached during incidents by people who mean well- A
BLOCKrule without ablock_response, and anOVERRIDEwithout a domain, are both refused by preconditions rather than by the API several minutes in
Verification
Static validation runs tofu fmt, init, validate, tflint and checkov.
This module has not yet had a live test, so it is published as statically
validated with its live test pending and does not carry the live-tested mark.
Usage code & full reference need an account
The complete copy-paste usage, the full input/output reference, and operational notes are free with an account - shown here and bundled in the download. Sign in and this section fills in.
- Usage
Related modules
aws-route53-resolver
Endpoints that carry DNS across the VPC boundary, with a precondition requiring addresses in two different subnets - the part the API does not check, and the reason a zone failure becomes every application failing at once.
aws-route53
A Route 53 hosted zone (public or private via vpc_ids) plus a map-driven set of records, with name normalisation and the alias-vs-rdata distinction resolved and inputs validated.
akamai-edge-dns-zone
Authoritative Edge DNS zone with full recordset management on Akamai's DDoS-resilient anycast network.
akamai-gtm-failover
Global Traffic Management domain with datacenters and failover or weighted-round-robin properties plus liveness tests.
azure-private-dns
A self-contained Azure Private DNS zone with virtual-network links and optional record sets for private name resolution across VNets and Private Endpoints - VM auto-registration off by default.
azure-dns-zone
An Azure public DNS zone plus a map-driven set of record sets - A, AAAA, CNAME, TXT, MX, NS, CAA and SRV - with relative naming, verbatim TXT values, and apex footgun guards.