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
Unraid has no native Terraform provider. Here's how to manage the infrastructure around it instead: Cloudflare Tunnel, Backblaze B2 backups, and DNS.
Unraid has no Terraform provider. Like Synology, the realistic pattern is Terraform around it: Cloudflare / Tailscale / S3 / Backblaze B2 — declaratively managed. Containers and shares stay in the Unraid UI.
terraform {
required_providers {
cloudflare = {
source = "cloudflare/cloudflare"
version = "~> 5.0"
}
}
}
resource "cloudflare_zero_trust_tunnel_cloudflared" "homelab" {
account_id = var.cf_account_id
name = "unraid-homelab"
config_src = "cloudflare"
}
resource "cloudflare_dns_record" "jellyfin" {
zone_id = var.cf_zone_id
name = "jellyfin"
type = "CNAME"
content = "${cloudflare_zero_trust_tunnel_cloudflared.homelab.id}.cfargotunnel.com"
proxied = true
ttl = 1
}terraform {
required_providers {
b2 = { source = "Backblaze/b2", version = "~> 0.10" }
}
}
resource "b2_bucket" "unraid_backup" {
bucket_name = "unraid-${var.hostname}-backup"
bucket_type = "allPrivate"
lifecycle_rules {
file_name_prefix = ""
days_from_uploading_to_hiding = 0
days_from_hiding_to_deleting = 30
}
}
resource "b2_application_key" "unraid_backup" {
key_name = "unraid-backup"
capabilities = ["listBuckets", "readFiles", "writeFiles", "deleteFiles"]
bucket_id = b2_bucket.unraid_backup.bucket_id
}Configure Unraid Duplicacy or rclone plugin with the B2 key.
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.
Manage TrueNAS Scale (Linux + ZFS) with Terraform using the dariusbakunas/truenas provider — datasets, NFS/SMB shares, snapshots, and replication jobs.
Provision VMs on Proxmox VE with Terraform using the bpg/proxmox provider: API token auth, cloud-init, LXC containers, and storage pools.
Run Terraform in Docker containers for consistent CI/CD environments. Official HashiCorp image, custom Dockerfiles, and Docker Compose workflows.