Terraform provider reference / resources / server_backup_policy
fiberax_server_backup_policy (Resource)
Backup policy of a server. ONE resource per server.
The switch and the schedule are one thing. enabled means both that backups are taken and that they are billed: you pay for having a live schedule, not for the number of backups taken.
Switching off does not lose your settings - the schedule is switched off, not deleted, and the days and the hour are kept until the next time you switch it on. Backups already taken are not deleted either, and keeping them is not billed separately.
The resource has no create and no delete: a server always has a policy. Destroying the resource DOES NOT TOUCH the platform - backups keep being taken and keep being billed.
A side effect worth knowing. Any write of the policy PINS the server to a preference of its own, and from that moment the project-level default no longer touches it: a project-wide switch of backups skips such a server. There is no way to put it back under the shared default through the API - you can only describe it explicitly here.
Example Usage
# The backup policy. ONE resource per server.
#
# enabled is money: you pay for having a schedule in force, not for the number of
# backups taken.
resource "fiberax_server_backup_policy" "app" {
server_id = fiberax_server.app.id
enabled = true
days = ["mon", "wed", "fri"]
hour = 3
minute = 30
}
# Backups are off. The days and the hour are not lost - the schedule is switched off
# rather than deleted, and turning it back on brings them back.
resource "fiberax_server_backup_policy" "scratch" {
server_id = fiberax_server.scratch.id
enabled = false
}
Schema
Required
enabled(Boolean) Whether scheduled backups run. THIS IS MONEY: switching it on starts the billing, switching it off stops it immediately.server_id(Number) The server whose policy this describes. It is also the resource identifier.
Optional
days(Set of String) Days of the week:mon,tue,wed,thu,fri,sat,sun.
A set, not a list: the order of the days means nothing. Omit it and the platform keeps the current days, and for a server with no schedule picks them itself.
hour(Number) Hour of the run, 0 to 23, in the platform's time zone. Omit it and the current one is kept, and for a new schedule the platform picks a night hour itself.minute(Number) Minute of the run, 0 to 59.
Read-Only
keep(Number) How many backups are kept. Set by the product, you cannot set it here - an attempt is refused as an unknown field.
Import
Import is supported using the following syntax:
The terraform import command can be used, for example:
# The import ID is the server ID: a server has exactly one policy. terraform import fiberax_server_backup_policy.app 10867
Generated from the provider schema for version 0.3.0. How to install the provider: Terraform provider.