strata
strata is a declarative YAML layer over Terraform, Helm, and Docker Compose: infrastructure and deployments are described once as plain YAML documents, validated as a whole, then rendered and executed by whichever provisioner a workspace declares.
This is v2 — a ground-up rebuild, redesigned from lessons learned tracing v1’s real behaviour (see docs/decisions/ for the full ADR trail). For the current implementation status of each document kind, see docs/design/v2-schema-overview.md — this page is the practical, task-focused guide; that one is the up-to-date status table.
Table of Contents
Key Features
Declarative YAML configuration — every document follows the same Kubernetes-style shape (
apiVersion,kind,meta,spec), validated with Pydantic v2 in strict mode (extra="forbid"— unknown fields are a validation error, not a silent typo).Documents, not file paths. Every cross-document reference is
(kind, meta.name)— never a path — so renaming or reorganizing files never breaks a reference.Solution-wide discovery. One
strata.yaml(kind: solution) marks the root; every document under it is discovered and indexed automatically, in any directory layout you like.Two-phase validation. Schema checks (Pydantic) first, then cross-document semantics — dangling references, unresolved variables, mismatched kinds, stale version pins — all before anything is rendered or applied.
render, then execute.
build runrenders a deployment’s workspace into on-disk Terraform/ Helm/Compose artifacts;deploy runis the only step that actually callsterraform plan/apply(or the Helm/Compose equivalent) — and only against whatbuild runalready wrote.Pluggable value resolution.
${var:KEY}/${secret:KEY}/${feature:KEY}tokens resolve against named stores — constants, environment variables, or an integration-backed secret store — so the same document works unchanged across environments.Scriptable by design.
--output json(orSTRATA_OUTPUT=json) emits one structured JSON envelope per run on stdout, with stable exit codes — built for CI pipelines and AI agents, not just interactive use.
Prerequisites
Tool |
Version |
Required for |
|---|---|---|
Python |
3.13+ |
CLI runtime ( |
latest |
Package and environment management |
|
1.5+ |
Only if a workspace uses a |
|
3.x |
Only if a workspace uses a |
|
v2 |
Only if a workspace uses a |
Installation
Not published to PyPI yet — run from a development install:
uv sync
.\.venv\Scripts\Activate.ps1
strata --help
Or without activating:
uv run strata --help
Quick Start
The config/ directory is a real, working solution — not a toy fixture —
so every command below actually runs against it:
cd config
# Validate every document in the solution
strata validate
# Inspect resolved values before building anything
strata values get prd-deployment REGION PUBLIC_IP
# Render the deployment's workspace to disk (Terraform/Helm/Compose artifacts)
strata build run prd-deployment
# Report what deploy run would do, without calling any provisioner
strata deploy run prd-deployment --dry-run
Document Shape
Every strata document follows the same shape:
apiVersion: strata.huybrechts.xyz/v2
kind: deployment # see docs/design/v2-schema-overview.md for the full kind list
meta:
name: prd-deployment
annotations:
description: "Production instance"
spec:
...
Full, current kind list and implementation status: docs/design/v2-schema-overview.md.
CLI Reference
Command |
Purpose |
|---|---|
|
Schema + cross-document validation for the whole solution |
|
Resolve one or more variables/secrets/feature flags for a deployment |
|
Render a deployment’s workspace into on-disk artifacts |
|
Execute |
|
Show the strata version |
Common options accepted by most commands:
Option |
Description |
|---|---|
|
Where to start looking for the solution (or |
|
Output format (default: |
|
More or less console output |
build run/deploy run also accept --build-path and --dry-run; deploy run adds --stage/
--scope to restrict which provisioning steps run. Run strata <command> --help for the full,
authoritative list.
Deployment Workflow
strata validate— check every document’s schema and cross-document references.strata values get— inspect resolved variables/secrets/feature flags before building anything.strata build run— render the deployment’s workspace into on-disk Terraform/Helm/Compose artifacts. Renders only — never callsplan,apply, ordeploy.strata deploy run— execute whatbuild runwrote:terraform plan/apply(or the Helm/ Compose equivalent), per provisioning step, in dependency order.
Testing
& .\.venv\Scripts\python.exe -m mypy src
& .\.venv\Scripts\python.exe -m ruff check --fix src tests
& .\.venv\Scripts\lint-imports.exe
& .\.venv\Scripts\python.exe -m pytest -q
See CONTRIBUTING.md for the full workflow.
Troubleshooting
Symptom |
Likely cause |
Fix |
|---|---|---|
|
Command run outside any solution tree |
|
Exit code |
Bad arguments, or not inside a solution |
Check |
Exit code |
Schema or cross-document validation failed |
Read the reported diagnostics — each names the failing field |
Exit code |
System failure (I/O, unexpected crash) |
Not a configuration problem — check the traceback/logs |
|
A |
Export it before running |
Exit code reference: 0 success · 1 system failure · 2 usage error · 3 validation failure.
Contributing
See CONTRIBUTING.md for workflow, conventions, and architecture rules.
Security
See SECURITY.md for the vulnerability reporting policy.
License
GNU Affero General Public License v3.0 (AGPL-3.0) — see LICENSE.
Glossary
Full list of terms and concepts: docs/GLOSSARY.md.