Skip to content

Search is only available in production builds. Try building and previewing the site to test it out locally.

Backup policy

platform_backup_policy schedules retained backups of a volume. A backup is a snapshot. source_volume_id forces replacement. Name, schedule, retention, and enabled update in place.

A policy needs a volume, so the two are usually applied together.

resource "platform_volume" "data" {
name = "data-1"
size_gb = 10
}
resource "platform_backup_policy" "nightly" {
name = "data-nightly"
source_volume_id = platform_volume.data.id
schedule = "daily"
retention_keep = 3
enabled = true
}

If schedule is omitted, the API default is daily.

NameRequiredNotes
nameyesUpdated in place
source_volume_idyesVolume to back up. Forces replacement
schedulenohourly, daily, weekly, or @every <dur>. Computed if omitted
retention_keepnoKeep N most recent backups (0 = unlimited). Computed if omitted
retention_daysnoExpire backups older than N days (0 = no expiry). Computed if omitted
enablednoComputed if omitted
NameNotes
idPlatform id
next_run_atNext scheduled run (RFC3339)

This resource does not run a backup on apply. The schedule does that. The API also has a run-now action; it is not a Terraform attribute.

Terminal window
terraform import platform_backup_policy.nightly pol_…