Terraform providers
ActiveTrueNAS SCALE and Alta Labs routers, managed declaratively.
Two providers for the gear in our own rack, each built on an API that was never meant to be driven this way.
The TrueNAS provider brings TrueNAS SCALE 25.10+ under Terraform through its versioned JSON-RPC WebSocket API: datasets, shares, snapshot and replication tasks, users, VMs, apps, iSCSI, certificates and system settings, over 40 resources, each with a matching data source. Resources are short specs derived from TrueNAS’s own API schema and run through one generic engine. Secrets use write-only attributes so they never land in state, and a read_only mode makes it safe to plan against a production box.
Alta Labs publishes no API, so the Alta provider writes VLANs, routes, port forwards, firewall rules, DHCP reservations and switch ports through the Alta cloud, keeping the vendor portal in sync with what Terraform applied. Every apply is one gated, commit-confirmed transaction: the router’s cloud agent is paused, a single push is released, and the router rolls itself back unless health probes pass.
Highlights
- TrueNAS: 40+ resources, write-only secrets, list/query import
- Terraform 1.14 actions: run a replication, scrub a pool, restart an app
- Alta: commit-confirmed applies with automatic rollback
- Alta’s observed API is recorded and re-checked against a live router
In practice
provider "truenas" {
host = "nas.lan"
username = "truenas_admin"
# api_key from TRUENAS_API_KEY
}
resource "truenas_snapshot_task" "home" {
dataset = "tank/home"
recursive = true
lifetime_value = 14
lifetime_unit = "DAY"
schedule = {
minute = "45"
hour = "2"
}
} resource "alta_vlan" "lab" {
vlan_id = 40
name = "Lab"
router_ip = "198.18.40.1/24"
}
resource "alta_dhcp_reservation" "printer" {
mac = "02:00:00:aa:bb:cc"
ip = cidrhost(alta_vlan.lab.subnet, 40)
} Both are pre-1.0. The TrueNAS provider is published on the Terraform Registry; the Alta provider is installed from source for now. Alta support is unofficial and unaffiliated with Alta Labs.