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.
Arguments
Section titled “Arguments”| Name | Required | Notes |
|---|---|---|
name | yes | Updated in place |
source_volume_id | yes | Volume to back up. Forces replacement |
schedule | no | hourly, daily, weekly, or @every <dur>. Computed if omitted |
retention_keep | no | Keep N most recent backups (0 = unlimited). Computed if omitted |
retention_days | no | Expire backups older than N days (0 = no expiry). Computed if omitted |
enabled | no | Computed if omitted |
Attributes
Section titled “Attributes”| Name | Notes |
|---|---|
id | Platform id |
next_run_at | Next 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.
Import
Section titled “Import”terraform import platform_backup_policy.nightly pol_…