Skip to main content
Experimental and unit-tested only. The package lives in sdk/iac-typescript (@levelrail/iac), is not published yet, and has no dependencies. Set APP_EXPERIMENTAL=iac before you run diff or apply on its output.
The package only writes files. Plan, diff, apply, prune, drift, approvals and secrets are unchanged: it produces the YAML documents described in IaC resource kinds, and the control plane never runs your code.

Example

Run it with Node 22.18 or later (node infra.ts), then:
Commit out/ so a review shows the YAML diff. Output is one file per resource (out/app/web.yaml), keys sorted, byte-identical when the code is unchanged.

What it covers

Git builds are not available: apply only accepts image builds today. .extra({...}) sets any other service field the schema allows.

Guards

  • A literal on a secret-looking key (or a token-shaped value) throws at synth and names the key, never the value. The server guard remains the real gate.
  • Names are checked against the schema pattern, so a name can never escape the output folder; symlinked output paths are refused.
  • Undeclared project or database references print warnings, since the target may exist live.
  • Limits: LEVELRAIL_IAC_SYNTH_MAX_FILES (default 500) and LEVELRAIL_IAC_SYNTH_MAX_BYTES (default 5 MiB).
Removing a domain or env key from code does not remove it live unless you apply with --prune --source, the same as hand-written YAML.
Last modified on November 30, 2026