A source of truth is the authoritative representation used to evaluate and correct a system’s state. For infrastructure, centralizing deployment around a shared repository prevents team members from overwriting changes made from separate laptops and makes the configuration behind running infrastructure easy to find. section 8.2.1 section 8.3
GitOps applies the pattern through four operating principles:
- Declarative: express the desired system state as declarations rather than deployment steps. section 8.3
- Versioned and immutable: store desired state with enforced versioning and a complete history. section 8.3
- Pulled automatically: let software agents retrieve desired-state declarations from the source. section 8.3
- Continuously reconciled: observe actual state and attempt to bring it back to the declared state. section 8.3
A centralized Terraform workflow
Alice and Bob commit infrastructure code to a shared Git repository instead of deploying independently from their laptops. An automated deployment system reads that repository and applies the configuration, allowing the repository to represent the infrastructure that should be running. section 8.2.1 section 8.3
The pattern also defines how to handle drift. When infrastructure changes outside the declared configuration, reconciliation detects the difference and attempts to restore the source-of-truth state. Terraform can detect and fix drift, but requires a larger system for reconciliation that runs beyond pull requests or merges, such as scheduled execution. section 8.3.2







