Platform · Config as data
Vault as the Control Plane: A Five-Tier Key Model with Locking
All onboarding configuration lives in Vault as typed keys layered from defaults to overrides to computed values, with a lock that protects customisations from re-runs.
// Overview
Terraform has no hardcoded team configuration. A Python populator writes standard defaults, then team overrides, then computed values; Terraform decodes each key (string, boolean, integer, JSON, list) and writes results back for downstream stages. A lock key stops later runs from overwriting live edits. The operator guide covers safe changes, rollback via KV v2 versions and adding new keys end to end.
// The problem
When CSV defaults, form values, manual edits and computed values all write the same store, config drifts and gets overwritten, and guessing at key types produces broken plans.
// Flow
- Standard defaultsversion, network plugin, private cluster, feature flags per team and environment
- Computed defaultsnames and sizes derived from region and zone support
- Team overridesform values overwrite the defaults
- Network allocationfirst free block taken from a pool and marked allocated
- Lock set gatea locked flag stops later runs from overwriting customisations
- Terraform readone data source reads the secret; locals decode types, with safe defaults for optional keys
- Write-backoutputs such as cluster and identity ids are saved for later stages
- Change procedureread key and version, modify, write, plan; roll back via version history
- Offboardinglock reset and team removed from the registry so the name can be reused
// Design decisions & guardrails
- Five tiers: standard CSV, team CSV, injected values, live edits, Terraform outputs. A key missing from the standard CSV is not missing from the system.
- JSON-blob keys must be read before write, because a blind put destroys fields it does not re-specify.
- Re-running the first stage resets team-CSV keys to their CSV values and re-locks; the lock does not protect the computed layer. This is documented, not hidden.
- A missing required key fails the plan; there are no silent defaults.
- Secrets are never in the repo or workflow; only generic path shapes are documented.
// Outcome
Typed, versioned, rollback-able configuration for every environment, with 35+ standard keys per customer environment.