| SR-F-01 (Triggers) |
Defined in SR-005: only a person starts infra.yml, on main, with a commit, a target and plan or apply. |
BR-1.4 (BRD-INFRA-001) |
| SR-F-02 (Scan Gate) |
Every run scans the commit for dependencies, secrets and IaC misconfiguration with Trivy, failing on HIGH/CRITICAL findings, per SR-004 SR-F-01..03, before it plans. |
BR-1.1 (BRD-004) |
| SR-F-03 (Plan and Apply) |
A run checks out the commit and runs tofu init and tofu plan -out for the target’s root (deploy/infra/nonprod or deploy/infra/prod). With action: apply it then runs tofu apply on that plan file. |
BR-1.1, BR-1.4 (BRD-INFRA-001) |
| SR-F-04 (Infra Definition) |
Both roots call the shared module deploy/modules/site/: media bucket, Pages project, DNS, firewall and rate-limit rules, TLS and zone settings, and mail records. |
BR-1.1 (BRD-INFRA-001) |
| SR-F-05 (Values From the Vault) |
The job runs in the target’s GitHub environment, whose only secret is the value of that environment’s read-only 1Password service account. It loads the infrastructure token, the state key pair, the state passphrase, the zone, the account ID and the storage address from the target’s vault by op:// reference (SR-INFRA-002 SR-F-09), under the same variable names the non-production dev container uses; only the token and state key pair are the pipeline’s own. |
BR-1.3 (BRD-INFRA-001) |
| SR-F-06 (Pull Request Behaviour) |
Pull requests start no workflow; formatting and validation run locally in the dev container (tofu fmt -check, init -backend=false, validate). |
BR-1.4 (BRD-INFRA-001) |
| SR-F-07 (Persistent Remote State) |
OpenTofu state is stored in the private state bucket through the s3 backend pointed at the account’s R2 S3 endpoint, so state survives ephemeral runners. The bucket is not managed by this configuration. |
BR-1.1, BR-1.3 (BRD-INFRA-001) |
| SR-F-08 (Bootstrap) |
The state bucket is created by the Cloudflare bootstrap layer, and the pipeline tokens by the project-setup layer, before the first run. |
BR-1.3 (BRD-INFRA-001) |
| SR-F-09 (Encrypt Before Upload) |
OpenTofu encrypts state and plans client-side (SR-INFRA-001 SR-F-03), enforced for both, before they are written; the passphrase exists only in the target’s vault and the runner’s memory. |
BR-1.3 (BRD-INFRA-001) |
| SR-F-10 (Backend Init Wiring) |
The R2 S3 endpoint (https://<account-id>.r2.cloudflarestorage.com) reaches the backend as AWS_ENDPOINT_URL_S3, built from the account variable; tofu init uses a read-only lock file. |
BR-1.1, BR-1.3 (BRD-INFRA-001) |
| SR-F-11 (R2 Compatibility Settings) |
The s3 backend is configured with region = "auto" and the AWS-only checks disabled: skip_credentials_validation, skip_region_validation, skip_requesting_account_id, skip_metadata_api_check and skip_s3_checksum, all true, because R2 implements object storage only. |
BR-1.1, BR-1.2 (BRD-INFRA-001) |