Módulos versionados, planes revisados, sin cambios manuales en la consola.
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.
-
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.
-
Reviewed plans. Every change goes through a pull request where CI posts the
terraform planoutput for each affected environment. The apply uses that saved plan, and a plan that destroys or replaces a stateful resource needs a second approval. -
No manual changes in the console. Resources are created and changed only through Terraform. A scheduled drift check runs
terraform planon every environment, and any drift is either imported or reverted, then recorded. -
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.
-
Pinned providers and versions.
required_versionandrequired_providerspin Terraform and every provider, and.terraform.lock.hclis committed. Upgrades are their own pull requests. -
No secrets in code or state outputs. Secrets come from the secret manager at apply time and are marked
sensitive. A secret in a.tffile, atfvarsfile in Git or an unmarked output fails the review. -
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.