Terraform Provider for TrueNAS - Update (v0.5.0 & v0.6.0)
Hey everyone,
Two new releases to share since the last update. These add some highly desired features for backups and data protection.
v0.6.0 - Cloud Sync Support
Cloud Sync Credentials
Store credentials for cloud storage providers directly in Terraform. Supports S3-compatible storage, Backblaze B2, Google Cloud Storage, and Azure Blob Storage with provider-specific attribute blocks. (Note: Only S3 has been tested against real TrueNAS so far - other providers are implemented based on the API spec but untested. Feedback welcome!)
resource "truenas_cloud_sync_credentials" "backblaze" {
name = "backblaze-backup"
b2 {
account_id = var.b2_account_id
application_key = var.b2_app_key
}
}
Cloud Sync Tasks
Define backup jobs as code with full control over scheduling, encryption, and transfer settings. Supports push/pull directions, bandwidth limits, and pre/post scripts.
resource "truenas_cloud_sync_task" "nightly_backup" {
description = "Nightly backup to B2"
credentials = truenas_cloud_sync_credentials.backblaze.id
direction = "PUSH"
transfer_mode = "SYNC"
path = "/mnt/tank/important"
schedule {
minute = "0"
hour = "2"
dom = "*"
month = "*"
dow = "*"
}
encryption {
enabled = true
password = var.encryption_password
}
}
Cloud Sync Credentials Data Source
Look up existing credentials by name for use across configurations.
v0.5.0 - Snapshots & Cloning
Snapshot Resource
Create and manage ZFS snapshots with optional hold support to prevent accidental deletion.
resource "truenas_snapshot" "daily" {
dataset = "tank/data"
name = "daily-2026-01-16"
hold = true
}
Snapshots Data Source
Query existing snapshots with filtering by dataset or name pattern.
Dataset Cloning
Create new datasets from snapshots using the snapshot_id attribute - useful for test environments or point-in-time copies.
resource "truenas_dataset" "test_clone" {
pool = "tank"
path = "test-data"
snapshot_id = truenas_snapshot.daily.id
}
Version-Aware API Resolution
The provider now detects your TrueNAS version and adjusts API calls accordingly - better compatibility across SCALE releases.
Improved Error Reporting
Job failures now include relevant log excerpts directly in the Terraform output.
Install from Terraform Registry:
terraform {
required_providers {
truenas = {
source = "deevus/truenas"
version = "~> 0.6.0"
}
}
}
Feedback and issues welcome!