Architecture as Code

Describing system architecture in a versioned, text-based format so it can be reviewed, diffed, and validated like source code.

What is Architecture as Code?

Architecture as Code treats diagrams and models as derived artifacts of a source-of-truth file (YAML, DSL, or similar). The benefits are the familiar ones of infrastructure-as-code: pull-request review, CI validation, drift detection, and a single history where architecture and implementation change together.

Related terms

  • Conformance Rule — A machine-checkable constraint that validates the codebase against architectural intent.
  • Living Documentation — Documentation that is generated or validated from the running system, so it stays accurate as the system evolves.

Learn more