» google_filestore_instance

A Google Cloud Filestore instance.

To get more information about Instance, see:

» Example Usage - Filestore Instance Basic

resource "google_filestore_instance" "instance" {
  name = "test-instance"
  zone = "us-central1-b"
  tier = "PREMIUM"

  file_shares {
    capacity_gb = 2660
    name        = "share1"
  }

  networks {
    network = "default"
    modes   = ["MODE_IPV4"]
  }
}

» Example Usage - Filestore Instance Full

resource "google_filestore_instance" "instance" {
  provider = google-beta
  name = "test-instance"
  zone = "us-central1-b"
  tier = "BASIC_SSD"

  file_shares {
    capacity_gb = 2660
    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"]
  }
}

» Argument Reference

The following arguments are supported:

  • name - (Required) The resource name of the instance.

  • tier - (Required) The service tier of the instance. Possible values are TIER_UNSPECIFIED, STANDARD, PREMIUM, BASIC_HDD, BASIC_SSD, and HIGH_SCALE_SSD.

  • 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.

  • zone - (Required) The name of the Filestore zone of the instance.

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.

  • nfs_export_options - (Optional, Beta) 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 and 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 and 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.

The networks block supports:

  • 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, and MODE_IPV6.

  • reserved_ip_range - (Optional) A /29 CIDR block that identifies the range of IP addresses reserved for this instance.

  • ip_addresses - A list of IPv4 or IPv6 addresses.


  • description - (Optional) A description of the instance.

  • labels - (Optional) Resource labels to represent user-provided metadata.

  • project - (Optional) The ID of the project in which the resource belongs. If it is not provided, the provider project is used.

» Attributes Reference

In addition to the arguments listed above, the following computed attributes are exported:

  • id - an identifier for the resource with format projects/{{project}}/locations/{{zone}}/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.

» Timeouts

This resource provides the following Timeouts configuration options:

  • create - Default is 6 minutes.
  • update - Default is 6 minutes.
  • delete - Default is 6 minutes.

» Import

Instance can be imported using any of these accepted formats:

$ terraform import google_filestore_instance.default projects/{{project}}/locations/{{zone}}/instances/{{name}}
$ terraform import google_filestore_instance.default {{project}}/{{zone}}/{{name}}
$ terraform import google_filestore_instance.default {{zone}}/{{name}}
$ terraform import google_filestore_instance.default {{name}}

» User Project Overrides

This resource supports User Project Overrides.