Updated May 10, 2026
Manages a Raff snapshot — a point-in-time capture of a VM disk or a volume. Once taken, the source binding (resource_type, vm_id, volume_id) is immutable — Terraform owns the snapshot’s lifecycle (rename, delete). Restore is an imperative operation; use raff snapshot restore when you need it.
Example — VM snapshot
resource "raff_snapshot" "pre_upgrade" {
name = "web-01-pre-upgrade"
resource_type = "vm"
vm_id = raff_vm . web . id
}
Example — volume snapshot
resource "raff_snapshot" "data_weekly" {
name = "data-01-2026-05-10"
resource_type = "volume"
volume_id = raff_volume . data . id
}
Argument reference
Required
Argument Type Description namestring Snapshot name. Updates trigger a rename resource_typestring Source type: vm or volume. ForceNew
Optional (one required, depending on resource_type)
Argument Type Description vm_idstring (UUID) Source VM UUID. Required when resource_type = "vm". ForceNew volume_idint Source volume ID. Required when resource_type = "volume". ForceNew
Attribute reference (computed)
Attribute Description idSnapshot ID sizeSnapshot size (string, e.g. "50 GB") statusEmpty when saved-but-not-in-use; active when the source is currently reverted to this snapshot (cannot be deleted in this state) created_atRFC3339 timestamp
Lifecycle
Operation Behavior terraform apply (create)Captures a new snapshot Change name In-place rename Change resource_type / vm_id / volume_id Replacement — snapshots are immutable; Terraform destroys and recreatesterraform destroyDeletes the snapshot. Fails if status = "active" — restore the source elsewhere first
Importing existing snapshots
terraform import raff_snapshot.pre_upgrade < snapshot-i d >
Permissions
The API key needs snapshot.create, snapshot.manage, and snapshot.delete in the project. The system role Project Admin grants all of these.
Data sources
# Single snapshot by ID
data "raff_snapshot" "pre_upgrade" {
id = 17
}
# All snapshots in the current project
data "raff_snapshots" "all" {}
raff_backup Heavier-weight backup with retention.
raff_volume Block storage volumes.
CLI: raff snapshot Imperative equivalent.
Last modified on May 11, 2026