Skip to content

googleFilestoreSnapshot

A Google Cloud Filestore snapshot.

To get more information about Snapshot, see:

Example Usage - Filestore Snapshot Basic

/*Provider bindings are generated by running cdktf get.
See https://cdk.tf/provider-generation for more details.*/
import * as google from "./.gen/providers/google";
/*The following providers are missing schema information and might need manual adjustments to synthesize correctly: google.
For a more precise conversion please use the --provider flag in convert.*/
const googleFilestoreInstanceInstance =
  new google.filestoreInstance.FilestoreInstance(this, "instance", {
    file_shares: [
      {
        capacity_gb: 1024,
        name: "share1",
      },
    ],
    location: "us-central1",
    name: "test-instance-for-snapshot",
    networks: [
      {
        modes: ["MODE_IPV4"],
        network: "default",
      },
    ],
    tier: "ENTERPRISE",
  });
new google.filestoreSnapshot.FilestoreSnapshot(this, "snapshot", {
  instance: googleFilestoreInstanceInstance.name,
  location: "us-central1",
  name: "test-snapshot",
});

Example Usage - Filestore Snapshot Full

/*Provider bindings are generated by running cdktf get.
See https://cdk.tf/provider-generation for more details.*/
import * as google from "./.gen/providers/google";
/*The following providers are missing schema information and might need manual adjustments to synthesize correctly: google.
For a more precise conversion please use the --provider flag in convert.*/
const googleFilestoreInstanceInstance =
  new google.filestoreInstance.FilestoreInstance(this, "instance", {
    file_shares: [
      {
        capacity_gb: 1024,
        name: "share1",
      },
    ],
    location: "us-central1",
    name: "test-instance-for-snapshot",
    networks: [
      {
        modes: ["MODE_IPV4"],
        network: "default",
      },
    ],
    tier: "ENTERPRISE",
  });
new google.filestoreSnapshot.FilestoreSnapshot(this, "snapshot", {
  description: "Snapshot of test-instance-for-snapshot",
  instance: googleFilestoreInstanceInstance.name,
  labels: [
    {
      my_label: "value",
    },
  ],
  location: "us-central1",
  name: "test-snapshot",
});

Argument Reference

The following arguments are supported:

  • name - (Required) The resource name of the snapshot. 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 [aZ]([AZ09]*[aZ09])? 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.

  • location - (Required) The name of the location of the instance. This can be a region for ENTERPRISE tier instances.

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


  • description - (Optional) A description of the snapshot with 2048 characters or less. Requests with longer descriptions will be rejected.

  • 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/{{location}}/instances/{{instance}}/snapshots/{{name}}

  • state - The snapshot state.

  • createTime - The time when the snapshot was created in RFC3339 text format.

  • filesystemUsedBytes - The amount of bytes needed to allocate a full copy of the snapshot content.

Timeouts

This resource provides the following Timeouts configuration options:

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

Import

Snapshot can be imported using any of these accepted formats:

$ terraform import google_filestore_snapshot.default projects/{{project}}/locations/{{location}}/instances/{{instance}}/snapshots/{{name}}
$ terraform import google_filestore_snapshot.default {{project}}/{{location}}/{{instance}}/{{name}}
$ terraform import google_filestore_snapshot.default {{location}}/{{instance}}/{{name}}

User Project Overrides

This resource supports User Project Overrides.