ADR-INFRA-001 — Selection of the Declarative Infrastructure Engine
Status: Accepted Date: 2026-10-20 Authors: Engineering & Security Architecture Team
Context
Managing cloud resources by hand in a console leaves no reliable record of who changed what, lets settings drift silently, cannot be rolled back and takes hours to rebuild. BRD-INFRA-001 requires declarative configuration with protected state, open licensing and a reviewable plan. Specified in SR-INFRA-001. Who runs the engine, and where, is decided separately in ADR-INFRA-002, ADR-INFRA-004 and ADR-INFRA-005.
Decision Drivers (FRs & NFRs)
- BR-1.1 — every resource declared in version-controlled configuration.
- BR-1.2 — state encrypted on the client before it is stored.
- BR-1.3 — open, non-restrictive licence under neutral governance.
- BR-1.4 — a reviewable plan before every change.
Options
Option 1 — Manual console configuration
Pros:
- Nothing to set up: no engine, state bucket or code layout is needed first.
- Low barrier for a quick, throwaway experiment.
Cons:
- No audit trail: a console change leaves no versioned commit, so finding the cause of an incident is slow (BR-1.1).
- Silent drift: resources move away from the intended baseline with no alert.
- Recovery takes hours to days, because a lost environment is rebuilt by hand.
- No dry run, so a mistake can delete or expose an asset before anyone reviews it (BR-1.4).
- A past configuration cannot be inspected or rolled back.
Option 2 — HashiCorp Terraform
Pros:
- The most mature ecosystem, with exhaustive documentation and the widest set of community modules.
- Direct support for every major cloud provider and many SaaS platforms, including the Cloudflare provider.
- Declarative code and a plan step meet BR-1.1 and BR-1.4.
Cons:
- The Business Source Licence 1.1 brings legal uncertainty, possible commercial terms and vendor lock-in (BR-1.3).
- No built-in client-side state encryption: protection relies on the storage backend encrypting server-side, so whoever holds the backend’s keys or API access can reach plaintext state (BR-1.2).
- Closing that gap needs an external wrapper or a paid hosted service, which adds cost and another moving part.
Option 3 — OpenTofu 1.7 or later (CHOSEN)
Pros:
- Mozilla Public License 2.0 under Linux Foundation governance: long-term community stewardship and no usage fees (BR-1.3).
- Native
encryptionblock for state and plans, enforced. Data is encrypted in memory before it is sent to the backend, with the key held by the user and not the storage provider (BR-1.2). - Compatible with existing configuration syntax, state and Terraform providers, so the Cloudflare provider is used unchanged (BR-1.1).
- Standard plan and apply workflow gives the reviewable plan that prevents accidental destruction (BR-1.4).
Cons:
- A younger project with a smaller community than Terraform, though it uses the same provider registries.
- Terraform-only features, such as its hosted platform, will not be added.
- The two projects may diverge over time, so documentation written for Terraform may not always apply.
- State recovery depends on the passphrase; losing it makes state unreadable.
Final Decision
Adopt OpenTofu 1.7 or later as the engine for all infrastructure. Option 1 is rejected for its missing audit trail and rollback. Option 2 is rejected for its licence and its lack of client-side state encryption. The cost accepted is a smaller ecosystem, divergence from Terraform’s roadmap, and a passphrase held in the password manager that must be kept safe and rotated.