Architecture — Zone Baseline
Every site environment gets the same baseline in its own zone, declared once in the site repository’s shared module deploy/modules/site and called by the non-production root (L3) and the production root (L4). Requirements: SR-INFRA-008, whose IDs are used below, and SR-INFRA-009 SR-F-06. How a reader’s request passes this baseline is in the site’s Static Website Deployment Architecture.
1. Baseline per environment

2. What each zone gets
| Item | Setting | Module file | Requirement |
|---|---|---|---|
| DNS | A record for the host pointing at the Pages project, and www pointing at the host |
dns.tf |
— |
| TLS | Strict TLS to the origin | tls.tf |
SR-F-01 |
| HTTPS | Always HTTPS, and automatic HTTPS rewrites | tls.tf |
SR-F-02 |
| Minimum TLS | TLS 1.2 or later | tls.tf |
SR-F-03 |
| HSTS | On, without subdomains or preload; the maximum age is an input, so it can be raised in steps | tls.tf |
SR-F-04 |
| Managed ruleset | Cloudflare’s free managed ruleset, on by default on every free zone, so it is not declared again | — | SR-F-05 |
| Custom rules | Two of the zone’s five free custom rules: block every method other than GET and HEAD, and block common exploit probes. Free-plan operators only |
waf.tf |
SR-F-06 |
| Rate limit | The zone’s one free rate-limit rule, over the whole zone, counted per IP and data centre; a 10-second period and block, the only values the free plan accepts; the threshold is an input | waf.tf |
SR-F-07 |
| Threat settings | Security level medium and the browser integrity check, pinned in code so a dashboard change shows as drift |
security.tf |
SR-F-14 |
| Pages project | One project per environment, deployed by direct upload, served on the zone’s host through a custom domain | pages.tf |
SR-F-10 |
| Media bucket | Served at assets.<domain> through the zone, with its r2.dev address off; protected from deletion in code |
storage.tf |
— |
| Media expiry | Non-production only: objects older than a set number of days are deleted, to stay inside the free storage limit | storage.tf |
SR-F-11 |
The zone itself is created by the project-setup layer, not by this module, because creating a zone needs an account-level permission no site token holds. The domain’s mail records come with the zone from that layer too, so mail works before the nameservers move; this module declares only the site’s own records (ADR-INFRA-012). See Access Hand-Over.
3. What may differ between environments
Resource names are not inputs: the module builds them from the project and the environment (<project>-<environment>, <project>-<environment>-assets), so they differ only in that segment. The two roots pass the same inputs, with different values:
| Input | Why it differs |
|---|---|
| Zone, hostname | Each environment has its own zone and domain |
| Media expiry | Set in non-production only, to keep test media inside the free storage limit |
| HSTS maximum age, rate-limit threshold | Set per environment, so a change can be proven in non-production first |
Every other setting, rule and resource is the same in both, because both come from one module. A change to the baseline is merged to main, planned and applied by a person to non-production and tested there, and only then planned and applied, for the same commit, to production.