← Alle Vorlagen

Versionierte Module, geprüfte Pläne, keine manuellen Änderungen in der Konsole.

Constitution — Terraform infrastructure

Version 1.0.0 · Ratified 2026-11-10

These principles hold for every spec, plan and task of the infrastructure. A spec may add rules; it never weakens these.

  1. Versioned modules. Shared infrastructure is built from modules released with semantic version tags, and environments pin each module to an exact version. A module change is released before any environment uses it.

  2. Reviewed plans. Every change goes through a pull request where CI posts the terraform plan output for each affected environment. The apply uses that saved plan, and a plan that destroys or replaces a stateful resource needs a second approval.

  3. No manual changes in the console. Resources are created and changed only through Terraform. A scheduled drift check runs terraform plan on every environment, and any drift is either imported or reverted, then recorded.

  4. Remote state with locking. State lives in a remote backend with encryption and locking (for example S3 with DynamoDB, or Terraform Cloud), one state per environment and component. Nobody applies from a laptop with local state.

  5. Pinned providers and versions. required_version and required_providers pin Terraform and every provider, and .terraform.lock.hcl is committed. Upgrades are their own pull requests.

  6. No secrets in code or state outputs. Secrets come from the secret manager at apply time and are marked sensitive. A secret in a .tf file, a tfvars file in Git or an unmarked output fails the review.

  7. Checked before review. CI runs terraform fmt -check, terraform validate, tflint and a policy scanner (Checkov, tfsec or OPA) on every pull request. A failed check blocks the merge.