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
}
# Several runs a day: 1 to 4 times, "HH:MM" with leading zeros, at least 120 minutes apart,
# in the platform's time zone (Europe/Warsaw). hour and minute then read the first of them;
# write either times or hour and minute, not both. For one run a day both forms work:
# times = ["03:00"] is the same as hour = 3, minute = 0.
resource "fiberax_server_backup_policy" "db" {
server_id = fiberax_server.db.id
enabled = true
times = ["03:00", "15:00"]
}
# 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.
With several times this is the hour of the first of them.
minute(Number) Minute of the run, 0 to 59. With severaltimesthis is the minute of the first of them.times(Set of String) Times of day the backups run,"HH:MM"with leading zeros ("03:00", not"3:00"), 1 to 4 of them, at least 120 minutes apart (the gap from the last time of a day to the first one of the next day counts too). In the platform's time zone (Europe/Warsaw). A set: the order means nothing, the platform reads them back in ascending order.
Set either times or hour and minute, not both. hour and minute are always the FIRST of the times, so for one time a day both forms describe the same schedule: times = ["03:00"] equals hour = 3 with minute = 0.
Removing times from the configuration does not fold the schedule back to one time: the server keeps all of its times. On a server with several times hour and minute may only repeat the first one; any other value is refused (backup_schedule_multiple_times) - write times instead.
Omit it and the platform keeps the current times, and for a new schedule picks a night time itself.
Read-Only
keep(Number) How many backups are kept. Set by the product and read-only: Terraform refuses a configuration that sets it.
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.11.0. How to install the provider: Terraform provider.