Terraform for Synology DSM NAS: What Actually Works
No official Terraform provider exists for Synology DSM. Here's the realistic pattern: configure S3/B2 backups, Hyper Backup, DNS, VPN, and the DSM API from Terraform — homelab best practices.
DevOps
Manage TrueNAS Scale (Linux + ZFS) with Terraform using the dariusbakunas/truenas provider — datasets, NFS/SMB shares, snapshots, and replication jobs.
TrueNAS Scale is iXsystems' Linux + ZFS appliance OS, with Kubernetes-based apps and replication. You can manage it with Terraform via the community dariusbakunas/truenas provider, which drives the REST API to create datasets, shares, snapshots, and replication jobs.
terraform {
required_providers {
truenas = {
source = "dariusbakunas/truenas"
version = "~> 0.13"
}
}
}
provider "truenas" {
api_key = var.truenas_api_key
base_url = "https://${var.truenas_host}/api/v2.0"
}resource "truenas_dataset" "media" {
pool = "tank"
name = "media"
compression = "lz4"
recordsize = "1M"
atime = "OFF"
}
resource "truenas_share_nfs" "media" {
paths = [truenas_dataset.media.mountpoint]
comment = "media share"
hosts = ["10.0.0.0/24"]
maproot_user = "root"
maproot_group = "wheel"
}resource "truenas_pool_snapshottask" "media_daily" {
dataset = truenas_dataset.media.id
recursive = true
lifetime_value = 14
lifetime_unit = "DAY"
naming_schema = "auto-%Y-%m-%d_%H-%M"
schedule {
minute = "0"
hour = "2"
}
}recordsize=1M for media, default 128 K for general purpose.No official Terraform provider exists for Synology DSM. Here's the realistic pattern: configure S3/B2 backups, Hyper Backup, DNS, VPN, and the DSM API from Terraform — homelab best practices.
Unraid has no native Terraform provider. Here's how to manage the infrastructure around it instead: Cloudflare Tunnel, Backblaze B2 backups, and DNS.
Manage Oracle Solaris legacy workloads with Terraform on Oracle Cloud Infrastructure: SPARC bare metal, ZFS, zones, and hybrid migration.
Provision SmartOS / Illumos infrastructure with Terraform: zones, ZFS datasets, vmadm-managed VMs, and the Triton DataCenter / Joyent successor stack.