A Google Cloud Filestore instance.
To get more information about Instance, see:
resource "google_filestore_instance" "instance" {
name = "test-instance"
location = "us-central1-b"
tier = "BASIC_HDD"
file_shares {
capacity_gb = 1024
name = "share1"
}
networks {
network = "default"
modes = ["MODE_IPV4"]
}
}
resource "google_filestore_instance" "instance" {
name = "test-instance"
location = "us-central1-b"
tier = "BASIC_SSD"
file_shares {
capacity_gb = 2560
name = "share1"
nfs_export_options {
ip_ranges = ["10.0.0.0/24"]
access_mode = "READ_WRITE"
squash_mode = "NO_ROOT_SQUASH"
}
nfs_export_options {
ip_ranges = ["10.10.0.0/24"]
access_mode = "READ_ONLY"
squash_mode = "ROOT_SQUASH"
anon_uid = 123
anon_gid = 456
}
}
networks {
network = "default"
modes = ["MODE_IPV4"]
connect_mode = "DIRECT_PEERING"
}
}
resource "google_filestore_instance" "instance" {
provider = google-beta
name = "test-instance"
location = "us-central1"
tier = "ENTERPRISE"
protocol = "NFS_V4_1"
file_shares {
capacity_gb = 1024
name = "share1"
}
networks {
network = "default"
modes = ["MODE_IPV4"]
}
}
resource "google_filestore_instance" "instance" {
name = "test-instance"
location = "us-central1"
tier = "ENTERPRISE"
file_shares {
capacity_gb = 1024
name = "share1"
}
networks {
network = "default"
modes = ["MODE_IPV4"]
}
kms_key_name = google_kms_crypto_key.filestore_key.id
}
resource "google_kms_key_ring" "filestore_keyring" {
name = "filestore-keyring"
location = "us-central1"
}
resource "google_kms_crypto_key" "filestore_key" {
name = "filestore-key"
key_ring = google_kms_key_ring.filestore_keyring.id
}
The following arguments are supported:
name
-
(Required)
The resource name of the instance.
tier
-
(Required)
The service tier of the instance.
Possible values include: STANDARD, PREMIUM, BASIC_HDD, BASIC_SSD, HIGH_SCALE_SSD, ZONAL, REGIONAL and ENTERPRISE
file_shares
-
(Required)
File system shares on the instance. For this version, only a
single file share is supported.
Structure is documented below.
networks
-
(Required)
VPC networks to which the instance is connected. For this version,
only a single network is supported.
Structure is documented below.
The file_shares
block supports:
name
-
(Required)
The name of the fileshare (16 characters or less)
capacity_gb
-
(Required)
File share capacity in GiB. This must be at least 1024 GiB
for the standard tier, or 2560 GiB for the premium tier.
source_backup
-
(Optional)
The resource name of the backup, in the format
projects/{projectId}/locations/{locationId}/backups/{backupId},
that this file share has been restored from.
nfs_export_options
-
(Optional)
Nfs Export Options. There is a limit of 10 export options per file share.
Structure is documented below.
The nfs_export_options
block supports:
ip_ranges
-
(Optional)
List of either IPv4 addresses, or ranges in CIDR notation which may mount the file share.
Overlapping IP ranges are not allowed, both within and across NfsExportOptions. An error will be returned.
The limit is 64 IP ranges/addresses for each FileShareConfig among all NfsExportOptions.
access_mode
-
(Optional)
Either READ_ONLY, for allowing only read requests on the exported directory,
or READ_WRITE, for allowing both read and write requests. The default is READ_WRITE.
Default value is READ_WRITE
.
Possible values are: READ_ONLY
, READ_WRITE
.
squash_mode
-
(Optional)
Either NO_ROOT_SQUASH, for allowing root access on the exported directory, or ROOT_SQUASH,
for not allowing root access. The default is NO_ROOT_SQUASH.
Default value is NO_ROOT_SQUASH
.
Possible values are: NO_ROOT_SQUASH
, ROOT_SQUASH
.
anon_uid
-
(Optional)
An integer representing the anonymous user id with a default value of 65534.
Anon_uid may only be set with squashMode of ROOT_SQUASH. An error will be returned
if this field is specified for other squashMode settings.
anon_gid
-
(Optional)
An integer representing the anonymous group id with a default value of 65534.
Anon_gid may only be set with squashMode of ROOT_SQUASH. An error will be returned
if this field is specified for other squashMode settings.
network
-
(Required)
The name of the GCE VPC network to which the
instance is connected.
modes
-
(Required)
IP versions for which the instance has
IP addresses assigned.
Each value may be one of: ADDRESS_MODE_UNSPECIFIED
, MODE_IPV4
, MODE_IPV6
.
reserved_ip_range
-
(Optional)
A /29 CIDR block that identifies the range of IP
addresses reserved for this instance.
ip_addresses
-
(Output)
A list of IPv4 or IPv6 addresses.
connect_mode
-
(Optional)
The network connect mode of the Filestore instance.
If not provided, the connect mode defaults to
DIRECT_PEERING.
Default value is DIRECT_PEERING
.
Possible values are: DIRECT_PEERING
, PRIVATE_SERVICE_ACCESS
.
description
-
(Optional)
A description of the instance.
protocol
-
(Optional, Beta)
Either NFSv3, for using NFS version 3 as file sharing protocol,
or NFSv4.1, for using NFS version 4.1 as file sharing protocol.
NFSv4.1 can be used with HIGH_SCALE_SSD, ZONAL, REGIONAL and ENTERPRISE.
The default is NFSv3.
Default value is NFS_V3
.
Possible values are: NFS_V3
, NFS_V4_1
.
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.
kms_key_name
-
(Optional)
KMS key name used for data encryption.
zone
-
(Optional, Deprecated)
The name of the Filestore zone of the instance.
~> Warning: zone
is deprecated and will be removed in a future major release. Use location
instead.
location
-
(Optional)
The name of the location of the instance. This can be a region for ENTERPRISE tier instances.
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}}/instances/{{name}}
create_time
-
Creation timestamp in RFC3339 text format.
etag
-
Server-specified ETag for the instance resource to prevent
simultaneous updates from overwriting each other.
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.Instance can be imported using any of these accepted formats:
projects/{{project}}/locations/{{location}}/instances/{{name}}
{{project}}/{{location}}/{{name}}
{{location}}/{{name}}
In Terraform v1.5.0 and later, use an import
block to import Instance using one of the formats above. For example:
import {
id = "projects/{{project}}/locations/{{location}}/instances/{{name}}"
to = google_filestore_instance.default
}
When using the terraform import
command, Instance can be imported using one of the formats above. For example:
$ terraform import google_filestore_instance.default projects/{{project}}/locations/{{location}}/instances/{{name}}
$ terraform import google_filestore_instance.default {{project}}/{{location}}/{{name}}
$ terraform import google_filestore_instance.default {{location}}/{{name}}
This resource supports User Project Overrides.