Terraform provider reference / resources / project_backup_policy

fiberax_project_backup_policy (Resource)

Backup default for the WHOLE project: the same switch you see when ordering the project and on the resources page in the client area.

ONE resource per project, and the project is set by the token itself - that is why the resource has no identifier field. There must not be two such resources in a configuration: they would overwrite one value after another, and the result would depend on the order.

The provider catches this when both are applied in ONE run and refuses. A second resource added next to an already applied one is not caught that way - but it gives itself away: its plan stops settling and offers the same change on every run.

How this relates to the policy of a single server. A new server IS CREATED with this default. Later the server may get a setting of its own (the resource fiberax_server_backup_policy or the switch in the client area), and from that moment the server lives by that setting: the project default NEVER touches it again - the platform cannot put a server back under the shared default.

So if the goal is no backups anywhere in the project, describe it HERE, not with a block per server: a per-server block takes the server out of inheritance for good.

Example Usage

# The backup default for the WHOLE project - the same switch you see when ordering a
# project and on the resources page in the client area.
#
# WARNING: writing it reaches WIDER than your configuration. It touches not only future
# servers, but every current one that has no backup setting of its own - including the
# ones this configuration does not mention at all.
resource "fiberax_project_backup_policy" "default" {
  enabled = true
}

# A single server may live by its own rules. But remember: once a server has a setting
# of its own, the project default NEVER touches it again - the platform cannot put a
# server back under the shared default.
#
# So write "no backups anywhere in the project" with the resource above, not with a
# block on every server.
resource "fiberax_server_backup_policy" "critical" {
  server_id = fiberax_server.db.id
  enabled   = true
  days      = ["mon", "tue", "wed", "thu", "fri", "sat", "sun"]
  hour      = 2
}

Schema

Required

THIS IS MONEY, AND IT REACHES WIDER THAN THE CONFIGURATION. The write applies not only to future servers but to every server you have NOW that has no setting of its own - including the ones that are not in this configuration at all. The switch in the client area behaves exactly the same way.

Import

Import is supported using the following syntax:

The terraform import command can be used, for example:

# The resource has no identifier of its own: the project comes from the token itself. An
# import ID is still required because Terraform demands a non-empty one - any word will do.
terraform import fiberax_project_backup_policy.default project

Generated from the provider schema for version 0.3.0. How to install the provider: Terraform provider.