Updated May 10, 2026
Manages a recurring backup schedule for a VM. The schedule auto-prunes backups older than keep_count, so backups it creates must not be managed via raff_backup — that fights the retention engine. For one-shot backups, use raff_backup.
Example — daily
resource "raff_backup_schedule" "api_nightly" {
vm_id = raff_vm . api . id
frequency = "daily"
time = "03:00"
keep_count = 14
}
Example — weekly
resource "raff_backup_schedule" "web_weekly" {
vm_id = raff_vm . web . id
frequency = "weekly"
day_of_week = "Saturday"
time = "04:00"
keep_count = 4
}
Argument reference
Required
Argument Type Description vm_idstring (UUID) Source VM. ForceNew — point at a different schedule’s VM by replacing the resource frequencystring daily or weeklytimestring Time of day, e.g. 08:00 or 8am keep_countint Number of backups to retain before auto-pruning
Optional
Argument Type Description day_of_weekstring Day of week (Monday–Sunday). Required when frequency = "weekly"
Attribute reference (computed)
Attribute Description idSchedule ID nameAuto-generated schedule name runtimeNext scheduled run time regionRegion (mirrors the source VM’s region) price_per_hourHourly price in USD for the storage the schedule’s backups consume
Lifecycle
Operation Behavior terraform apply (create)Creates the schedule. The first backup runs at the next time slot Change frequency, time, day_of_week, keep_count In-place update Change vm_id Replacement — destroy + recreateterraform destroyDeletes the schedule. Existing backups it created remain — delete via raff backup delete if no longer needed
Importing existing schedules
terraform import raff_backup_schedule.api_nightly < schedule-i d >
Permissions
The API key needs vm.backup in the project. The system role Project Admin grants this.
Data sources
# Single schedule by ID
data "raff_backup_schedule" "api_nightly" {
id = 9
}
# All schedules in the current project
data "raff_backup_schedules" "all" {}
raff_backup One-shot backup (don’t combine with schedule-created backups).
raff_vm Compute resource the schedule is attached to.
CLI: raff backup schedule Imperative equivalent.
Last modified on May 11, 2026