A Google Cloud Filestore backup.
To get more information about Backup, see:
resource "google_filestore_instance" "instance" {
name = "tf-fs-inst"
location = "us-central1-b"
tier = "BASIC_HDD"
file_shares {
capacity_gb = 1024
name = "share1"
}
networks {
network = "default"
modes = ["MODE_IPV4"]
connect_mode = "DIRECT_PEERING"
}
}
resource "google_filestore_backup" "backup" {
name = "tf-fs-bkup"
location = "us-central1"
description = "This is a filestore backup for the test instance"
source_instance = google_filestore_instance.instance.id
source_file_share = "share1"
labels = {
"files":"label1",
"other-label": "label2"
}
}
The following arguments are supported:
name
-
(Required)
The resource name of the backup. The name must be unique within the specified instance.
The name must be 1-63 characters long, and comply with
RFC1035. Specifically, the name must be 1-63 characters long and match
the regular expression [a-z]([-a-z0-9]*[a-z0-9])?
which means the
first character must be a lowercase letter, and all following
characters must be a dash, lowercase letter, or digit, except the last
character, which cannot be a dash.
source_instance
-
(Required)
The resource name of the source Cloud Filestore instance, in the format projects/{projectId}/locations/{locationId}/instances/{instanceId}, used to create this backup.
source_file_share
-
(Required)
Name of the file share in the source Cloud Filestore instance that the backup is created from.
location
-
(Required)
The name of the location of the instance. This can be a region for ENTERPRISE tier instances.
description
-
(Optional)
A description of the backup with 2048 characters or less. Requests with longer descriptions will be rejected.
labels
-
(Optional)
Resource labels to represent user-provided metadata.
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.
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}}/backups/{{name}}
state
-
The backup state.
create_time
-
The time when the snapshot was created in RFC3339 text format.
capacity_gb
-
The amount of bytes needed to allocate a full copy of the snapshot content.
storage_bytes
-
The size of the storage used by the backup. As backups share storage, this number is expected to change with backup creation/deletion.
source_instance_tier
-
The service tier of the source Cloud Filestore instance that this backup is created from.
download_bytes
-
Amount of bytes that will be downloaded if the backup is restored.
kms_key_name
-
KMS key name used for data encryption.
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.Backup can be imported using any of these accepted formats:
projects/{{project}}/locations/{{location}}/backups/{{name}}
{{project}}/{{location}}/{{name}}
{{location}}/{{name}}
In Terraform v1.5.0 and later, use an import
block to import Backup using one of the formats above. For example:
import {
id = "projects/{{project}}/locations/{{location}}/backups/{{name}}"
to = google_filestore_backup.default
}
When using the terraform import
command, Backup can be imported using one of the formats above. For example:
$ terraform import google_filestore_backup.default projects/{{project}}/locations/{{location}}/backups/{{name}}
$ terraform import google_filestore_backup.default {{project}}/{{location}}/{{name}}
$ terraform import google_filestore_backup.default {{location}}/{{name}}
This resource supports User Project Overrides.