Uapi: an http api as control plane for IaC (infrastructure as code)

I conceived uapi as a reliable backend to use terraform/tofu to manage openwrt.

It runs as a uhttpd-mod-ucode handler. There is no extra daemon, and it never writes to /etc/config/ directly, so uci stays the source of truth.

Every write is one transaction: snapshot, validate, commit, reload, and restore if the reload fails. UCI sections that uapi creates get a stable name, and pre-existing anonymous sections stay read-only until you adopt them.

Authentication is based on bearer tokens with precise scopes and validity.

Requirements: OpenWrt 25.12 or later, because the package uses apk. Because language is ucode, uapi is architecture independent, and every dependency comes from the base feed.

Version 3.0.0 is current. The first release came in May, and I ran every release since then on my own network.

You can find more info on the repo itself. You're very welcome to test it and fill reports. One class of report interests me more than the others. If uapi rejects a configuration that OpenWrt itself ships, please tell me.

uapi: https://github.com/openwrt-iac/uapi
Terraform provider: https://registry.terraform.io/providers/openwrt-iac/uapi

1 Like