A backup policy is used to schedule backups at regular daily, weekly, or monthly intervals. Backup policies allow you to attach a backup schedule to a volume. The policy defines how many backups to retain at daily, weekly, or monthly intervals.
To get more information about backupPolicy, see:
resource "google_netapp_backup_policy" "test_backup_policy_full" {
name = "test-backup-policy-full"
location = "us-central1"
daily_backup_limit = 2
weekly_backup_limit = 1
monthly_backup_limit = 1
description = "TF test backup schedule"
enabled = true
labels = {
"foo" = "bar"
}
}
The following arguments are supported:
daily_backup_limit
-
(Required)
Number of daily backups to keep. Note that the minimum daily backup limit is 2.
weekly_backup_limit
-
(Required)
Number of weekly backups to keep. Note that the sum of daily, weekly and monthly backups should be greater than 1.
monthly_backup_limit
-
(Required)
Number of monthly backups to keep. Note that the sum of daily, weekly and monthly backups should be greater than 1.
location
-
(Required)
Name of the region for the policy to apply to.
name
-
(Required)
The name of the backup policy. Needs to be unique per location.
labels
-
(Optional)
Labels as key value pairs. Example: { "owner": "Bob", "department": "finance", "purpose": "testing" }
.
Note: This field is non-authoritative, and will only manage the labels present in your configuration.
Please refer to the field effective_labels
for all of the labels present on the resource.
description
-
(Optional)
An optional description of this resource.
enabled
-
(Optional)
If enabled, make backups automatically according to the schedules.
This will be applied to all volumes that have this policy attached and enforced on volume level.
project
- (Optional) The ID of the project in which the resource belongs.
If it is not provided, the provider project is used.
In addition to the arguments listed above, the following computed attributes are exported:
id
- an identifier for the resource with format projects/{{project}}/locations/{{location}}/backupPolicies/{{name}}
create_time
-
Create time of the backup policy. A timestamp in RFC3339 UTC "Zulu" format. Examples: "2023-06-22T09:13:01.617Z".
state
-
The state of the backup policy.
assigned_volume_count
-
The total number of volumes assigned by this backup policy.
terraform_labels
-
The combination of labels configured directly on the resource
and default labels configured on the provider.
effective_labels
-
All of labels (key/value pairs) present on the resource in GCP, including the labels configured through Terraform, other clients and services.
This resource provides the following Timeouts configuration options:
create
- Default is 20 minutes.update
- Default is 20 minutes.delete
- Default is 20 minutes.backupPolicy can be imported using any of these accepted formats:
projects/{{project}}/locations/{{location}}/backupPolicies/{{name}}
{{project}}/{{location}}/{{name}}
{{location}}/{{name}}
In Terraform v1.5.0 and later, use an import
block to import backupPolicy using one of the formats above. For example:
import {
id = "projects/{{project}}/locations/{{location}}/backupPolicies/{{name}}"
to = google_netapp_backup_policy.default
}
When using the terraform import
command, backupPolicy can be imported using one of the formats above. For example:
$ terraform import google_netapp_backup_policy.default projects/{{project}}/locations/{{location}}/backupPolicies/{{name}}
$ terraform import google_netapp_backup_policy.default {{project}}/{{location}}/{{name}}
$ terraform import google_netapp_backup_policy.default {{location}}/{{name}}
This resource supports User Project Overrides.