1. Packages
  2. Google Cloud (GCP) Classic
  3. API Docs
  4. filestore
  5. Snapshot
Google Cloud v8.14.0 published on Wednesday, Jan 15, 2025 by Pulumi

gcp.filestore.Snapshot

Explore with Pulumi AI

A Google Cloud Filestore snapshot.

To get more information about Snapshot, see:

Example Usage

Filestore Snapshot Basic

import * as pulumi from "@pulumi/pulumi";
import * as gcp from "@pulumi/gcp";

const instance = new gcp.filestore.Instance("instance", {
    name: "test-instance-for-snapshot",
    location: "us-east1",
    tier: "ENTERPRISE",
    fileShares: {
        capacityGb: 1024,
        name: "share1",
    },
    networks: [{
        network: "default",
        modes: ["MODE_IPV4"],
    }],
});
const snapshot = new gcp.filestore.Snapshot("snapshot", {
    name: "test-snapshot",
    instance: instance.name,
    location: "us-east1",
});
Copy
import pulumi
import pulumi_gcp as gcp

instance = gcp.filestore.Instance("instance",
    name="test-instance-for-snapshot",
    location="us-east1",
    tier="ENTERPRISE",
    file_shares={
        "capacity_gb": 1024,
        "name": "share1",
    },
    networks=[{
        "network": "default",
        "modes": ["MODE_IPV4"],
    }])
snapshot = gcp.filestore.Snapshot("snapshot",
    name="test-snapshot",
    instance=instance.name,
    location="us-east1")
Copy
package main

import (
	"github.com/pulumi/pulumi-gcp/sdk/v8/go/gcp/filestore"
	"github.com/pulumi/pulumi/sdk/v3/go/pulumi"
)

func main() {
	pulumi.Run(func(ctx *pulumi.Context) error {
		instance, err := filestore.NewInstance(ctx, "instance", &filestore.InstanceArgs{
			Name:     pulumi.String("test-instance-for-snapshot"),
			Location: pulumi.String("us-east1"),
			Tier:     pulumi.String("ENTERPRISE"),
			FileShares: &filestore.InstanceFileSharesArgs{
				CapacityGb: pulumi.Int(1024),
				Name:       pulumi.String("share1"),
			},
			Networks: filestore.InstanceNetworkArray{
				&filestore.InstanceNetworkArgs{
					Network: pulumi.String("default"),
					Modes: pulumi.StringArray{
						pulumi.String("MODE_IPV4"),
					},
				},
			},
		})
		if err != nil {
			return err
		}
		_, err = filestore.NewSnapshot(ctx, "snapshot", &filestore.SnapshotArgs{
			Name:     pulumi.String("test-snapshot"),
			Instance: instance.Name,
			Location: pulumi.String("us-east1"),
		})
		if err != nil {
			return err
		}
		return nil
	})
}
Copy
using System.Collections.Generic;
using System.Linq;
using Pulumi;
using Gcp = Pulumi.Gcp;

return await Deployment.RunAsync(() => 
{
    var instance = new Gcp.Filestore.Instance("instance", new()
    {
        Name = "test-instance-for-snapshot",
        Location = "us-east1",
        Tier = "ENTERPRISE",
        FileShares = new Gcp.Filestore.Inputs.InstanceFileSharesArgs
        {
            CapacityGb = 1024,
            Name = "share1",
        },
        Networks = new[]
        {
            new Gcp.Filestore.Inputs.InstanceNetworkArgs
            {
                Network = "default",
                Modes = new[]
                {
                    "MODE_IPV4",
                },
            },
        },
    });

    var snapshot = new Gcp.Filestore.Snapshot("snapshot", new()
    {
        Name = "test-snapshot",
        Instance = instance.Name,
        Location = "us-east1",
    });

});
Copy
package generated_program;

import com.pulumi.Context;
import com.pulumi.Pulumi;
import com.pulumi.core.Output;
import com.pulumi.gcp.filestore.Instance;
import com.pulumi.gcp.filestore.InstanceArgs;
import com.pulumi.gcp.filestore.inputs.InstanceFileSharesArgs;
import com.pulumi.gcp.filestore.inputs.InstanceNetworkArgs;
import com.pulumi.gcp.filestore.Snapshot;
import com.pulumi.gcp.filestore.SnapshotArgs;
import java.util.List;
import java.util.ArrayList;
import java.util.Map;
import java.io.File;
import java.nio.file.Files;
import java.nio.file.Paths;

public class App {
    public static void main(String[] args) {
        Pulumi.run(App::stack);
    }

    public static void stack(Context ctx) {
        var instance = new Instance("instance", InstanceArgs.builder()
            .name("test-instance-for-snapshot")
            .location("us-east1")
            .tier("ENTERPRISE")
            .fileShares(InstanceFileSharesArgs.builder()
                .capacityGb(1024)
                .name("share1")
                .build())
            .networks(InstanceNetworkArgs.builder()
                .network("default")
                .modes("MODE_IPV4")
                .build())
            .build());

        var snapshot = new Snapshot("snapshot", SnapshotArgs.builder()
            .name("test-snapshot")
            .instance(instance.name())
            .location("us-east1")
            .build());

    }
}
Copy
resources:
  snapshot:
    type: gcp:filestore:Snapshot
    properties:
      name: test-snapshot
      instance: ${instance.name}
      location: us-east1
  instance:
    type: gcp:filestore:Instance
    properties:
      name: test-instance-for-snapshot
      location: us-east1
      tier: ENTERPRISE
      fileShares:
        capacityGb: 1024
        name: share1
      networks:
        - network: default
          modes:
            - MODE_IPV4
Copy

Filestore Snapshot Full

import * as pulumi from "@pulumi/pulumi";
import * as gcp from "@pulumi/gcp";

const instance = new gcp.filestore.Instance("instance", {
    name: "test-instance-for-snapshot",
    location: "us-west1",
    tier: "ENTERPRISE",
    fileShares: {
        capacityGb: 1024,
        name: "share1",
    },
    networks: [{
        network: "default",
        modes: ["MODE_IPV4"],
    }],
});
const snapshot = new gcp.filestore.Snapshot("snapshot", {
    name: "test-snapshot",
    instance: instance.name,
    location: "us-west1",
    description: "Snapshot of test-instance-for-snapshot",
    labels: {
        my_label: "value",
    },
});
Copy
import pulumi
import pulumi_gcp as gcp

instance = gcp.filestore.Instance("instance",
    name="test-instance-for-snapshot",
    location="us-west1",
    tier="ENTERPRISE",
    file_shares={
        "capacity_gb": 1024,
        "name": "share1",
    },
    networks=[{
        "network": "default",
        "modes": ["MODE_IPV4"],
    }])
snapshot = gcp.filestore.Snapshot("snapshot",
    name="test-snapshot",
    instance=instance.name,
    location="us-west1",
    description="Snapshot of test-instance-for-snapshot",
    labels={
        "my_label": "value",
    })
Copy
package main

import (
	"github.com/pulumi/pulumi-gcp/sdk/v8/go/gcp/filestore"
	"github.com/pulumi/pulumi/sdk/v3/go/pulumi"
)

func main() {
	pulumi.Run(func(ctx *pulumi.Context) error {
		instance, err := filestore.NewInstance(ctx, "instance", &filestore.InstanceArgs{
			Name:     pulumi.String("test-instance-for-snapshot"),
			Location: pulumi.String("us-west1"),
			Tier:     pulumi.String("ENTERPRISE"),
			FileShares: &filestore.InstanceFileSharesArgs{
				CapacityGb: pulumi.Int(1024),
				Name:       pulumi.String("share1"),
			},
			Networks: filestore.InstanceNetworkArray{
				&filestore.InstanceNetworkArgs{
					Network: pulumi.String("default"),
					Modes: pulumi.StringArray{
						pulumi.String("MODE_IPV4"),
					},
				},
			},
		})
		if err != nil {
			return err
		}
		_, err = filestore.NewSnapshot(ctx, "snapshot", &filestore.SnapshotArgs{
			Name:        pulumi.String("test-snapshot"),
			Instance:    instance.Name,
			Location:    pulumi.String("us-west1"),
			Description: pulumi.String("Snapshot of test-instance-for-snapshot"),
			Labels: pulumi.StringMap{
				"my_label": pulumi.String("value"),
			},
		})
		if err != nil {
			return err
		}
		return nil
	})
}
Copy
using System.Collections.Generic;
using System.Linq;
using Pulumi;
using Gcp = Pulumi.Gcp;

return await Deployment.RunAsync(() => 
{
    var instance = new Gcp.Filestore.Instance("instance", new()
    {
        Name = "test-instance-for-snapshot",
        Location = "us-west1",
        Tier = "ENTERPRISE",
        FileShares = new Gcp.Filestore.Inputs.InstanceFileSharesArgs
        {
            CapacityGb = 1024,
            Name = "share1",
        },
        Networks = new[]
        {
            new Gcp.Filestore.Inputs.InstanceNetworkArgs
            {
                Network = "default",
                Modes = new[]
                {
                    "MODE_IPV4",
                },
            },
        },
    });

    var snapshot = new Gcp.Filestore.Snapshot("snapshot", new()
    {
        Name = "test-snapshot",
        Instance = instance.Name,
        Location = "us-west1",
        Description = "Snapshot of test-instance-for-snapshot",
        Labels = 
        {
            { "my_label", "value" },
        },
    });

});
Copy
package generated_program;

import com.pulumi.Context;
import com.pulumi.Pulumi;
import com.pulumi.core.Output;
import com.pulumi.gcp.filestore.Instance;
import com.pulumi.gcp.filestore.InstanceArgs;
import com.pulumi.gcp.filestore.inputs.InstanceFileSharesArgs;
import com.pulumi.gcp.filestore.inputs.InstanceNetworkArgs;
import com.pulumi.gcp.filestore.Snapshot;
import com.pulumi.gcp.filestore.SnapshotArgs;
import java.util.List;
import java.util.ArrayList;
import java.util.Map;
import java.io.File;
import java.nio.file.Files;
import java.nio.file.Paths;

public class App {
    public static void main(String[] args) {
        Pulumi.run(App::stack);
    }

    public static void stack(Context ctx) {
        var instance = new Instance("instance", InstanceArgs.builder()
            .name("test-instance-for-snapshot")
            .location("us-west1")
            .tier("ENTERPRISE")
            .fileShares(InstanceFileSharesArgs.builder()
                .capacityGb(1024)
                .name("share1")
                .build())
            .networks(InstanceNetworkArgs.builder()
                .network("default")
                .modes("MODE_IPV4")
                .build())
            .build());

        var snapshot = new Snapshot("snapshot", SnapshotArgs.builder()
            .name("test-snapshot")
            .instance(instance.name())
            .location("us-west1")
            .description("Snapshot of test-instance-for-snapshot")
            .labels(Map.of("my_label", "value"))
            .build());

    }
}
Copy
resources:
  snapshot:
    type: gcp:filestore:Snapshot
    properties:
      name: test-snapshot
      instance: ${instance.name}
      location: us-west1
      description: Snapshot of test-instance-for-snapshot
      labels:
        my_label: value
  instance:
    type: gcp:filestore:Instance
    properties:
      name: test-instance-for-snapshot
      location: us-west1
      tier: ENTERPRISE
      fileShares:
        capacityGb: 1024
        name: share1
      networks:
        - network: default
          modes:
            - MODE_IPV4
Copy

Create Snapshot Resource

Resources are created with functions called constructors. To learn more about declaring and configuring resources, see Resources.

Constructor syntax

new Snapshot(name: string, args: SnapshotArgs, opts?: CustomResourceOptions);
@overload
def Snapshot(resource_name: str,
             args: SnapshotArgs,
             opts: Optional[ResourceOptions] = None)

@overload
def Snapshot(resource_name: str,
             opts: Optional[ResourceOptions] = None,
             instance: Optional[str] = None,
             location: Optional[str] = None,
             description: Optional[str] = None,
             labels: Optional[Mapping[str, str]] = None,
             name: Optional[str] = None,
             project: Optional[str] = None)
func NewSnapshot(ctx *Context, name string, args SnapshotArgs, opts ...ResourceOption) (*Snapshot, error)
public Snapshot(string name, SnapshotArgs args, CustomResourceOptions? opts = null)
public Snapshot(String name, SnapshotArgs args)
public Snapshot(String name, SnapshotArgs args, CustomResourceOptions options)
type: gcp:filestore:Snapshot
properties: # The arguments to resource properties.
options: # Bag of options to control resource's behavior.

Parameters

name This property is required. string
The unique name of the resource.
args This property is required. SnapshotArgs
The arguments to resource properties.
opts CustomResourceOptions
Bag of options to control resource's behavior.
resource_name This property is required. str
The unique name of the resource.
args This property is required. SnapshotArgs
The arguments to resource properties.
opts ResourceOptions
Bag of options to control resource's behavior.
ctx Context
Context object for the current deployment.
name This property is required. string
The unique name of the resource.
args This property is required. SnapshotArgs
The arguments to resource properties.
opts ResourceOption
Bag of options to control resource's behavior.
name This property is required. string
The unique name of the resource.
args This property is required. SnapshotArgs
The arguments to resource properties.
opts CustomResourceOptions
Bag of options to control resource's behavior.
name This property is required. String
The unique name of the resource.
args This property is required. SnapshotArgs
The arguments to resource properties.
options CustomResourceOptions
Bag of options to control resource's behavior.

Constructor example

The following reference example uses placeholder values for all input properties.

var gcpSnapshotResource = new Gcp.Filestore.Snapshot("gcpSnapshotResource", new()
{
    Instance = "string",
    Location = "string",
    Description = "string",
    Labels = 
    {
        { "string", "string" },
    },
    Name = "string",
    Project = "string",
});
Copy
example, err := filestore.NewSnapshot(ctx, "gcpSnapshotResource", &filestore.SnapshotArgs{
	Instance:    pulumi.String("string"),
	Location:    pulumi.String("string"),
	Description: pulumi.String("string"),
	Labels: pulumi.StringMap{
		"string": pulumi.String("string"),
	},
	Name:    pulumi.String("string"),
	Project: pulumi.String("string"),
})
Copy
var gcpSnapshotResource = new Snapshot("gcpSnapshotResource", SnapshotArgs.builder()
    .instance("string")
    .location("string")
    .description("string")
    .labels(Map.of("string", "string"))
    .name("string")
    .project("string")
    .build());
Copy
gcp_snapshot_resource = gcp.filestore.Snapshot("gcpSnapshotResource",
    instance="string",
    location="string",
    description="string",
    labels={
        "string": "string",
    },
    name="string",
    project="string")
Copy
const gcpSnapshotResource = new gcp.filestore.Snapshot("gcpSnapshotResource", {
    instance: "string",
    location: "string",
    description: "string",
    labels: {
        string: "string",
    },
    name: "string",
    project: "string",
});
Copy
type: gcp:filestore:Snapshot
properties:
    description: string
    instance: string
    labels:
        string: string
    location: string
    name: string
    project: string
Copy

Snapshot Resource Properties

To learn more about resource properties and how to use them, see Inputs and Outputs in the Architecture and Concepts docs.

Inputs

In Python, inputs that are objects can be passed either as argument classes or as dictionary literals.

The Snapshot resource accepts the following input properties:

Instance
This property is required.
Changes to this property will trigger replacement.
string
The resource name of the filestore instance.


Location
This property is required.
Changes to this property will trigger replacement.
string
The name of the location of the instance. This can be a region for ENTERPRISE tier instances.
Description string
A description of the snapshot with 2048 characters or less. Requests with longer descriptions will be rejected.
Labels Dictionary<string, string>

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.

Name Changes to this property will trigger replacement. string
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 a-z? 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.
Project Changes to this property will trigger replacement. string
The ID of the project in which the resource belongs. If it is not provided, the provider project is used.
Instance
This property is required.
Changes to this property will trigger replacement.
string
The resource name of the filestore instance.


Location
This property is required.
Changes to this property will trigger replacement.
string
The name of the location of the instance. This can be a region for ENTERPRISE tier instances.
Description string
A description of the snapshot with 2048 characters or less. Requests with longer descriptions will be rejected.
Labels map[string]string

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.

Name Changes to this property will trigger replacement. string
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 a-z? 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.
Project Changes to this property will trigger replacement. string
The ID of the project in which the resource belongs. If it is not provided, the provider project is used.
instance
This property is required.
Changes to this property will trigger replacement.
String
The resource name of the filestore instance.


location
This property is required.
Changes to this property will trigger replacement.
String
The name of the location of the instance. This can be a region for ENTERPRISE tier instances.
description String
A description of the snapshot with 2048 characters or less. Requests with longer descriptions will be rejected.
labels Map<String,String>

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.

name Changes to this property will trigger replacement. String
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 a-z? 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.
project Changes to this property will trigger replacement. String
The ID of the project in which the resource belongs. If it is not provided, the provider project is used.
instance
This property is required.
Changes to this property will trigger replacement.
string
The resource name of the filestore instance.


location
This property is required.
Changes to this property will trigger replacement.
string
The name of the location of the instance. This can be a region for ENTERPRISE tier instances.
description string
A description of the snapshot with 2048 characters or less. Requests with longer descriptions will be rejected.
labels {[key: string]: string}

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.

name Changes to this property will trigger replacement. string
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 a-z? 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.
project Changes to this property will trigger replacement. string
The ID of the project in which the resource belongs. If it is not provided, the provider project is used.
instance
This property is required.
Changes to this property will trigger replacement.
str
The resource name of the filestore instance.


location
This property is required.
Changes to this property will trigger replacement.
str
The name of the location of the instance. This can be a region for ENTERPRISE tier instances.
description str
A description of the snapshot with 2048 characters or less. Requests with longer descriptions will be rejected.
labels Mapping[str, str]

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.

name Changes to this property will trigger replacement. str
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 a-z? 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.
project Changes to this property will trigger replacement. str
The ID of the project in which the resource belongs. If it is not provided, the provider project is used.
instance
This property is required.
Changes to this property will trigger replacement.
String
The resource name of the filestore instance.


location
This property is required.
Changes to this property will trigger replacement.
String
The name of the location of the instance. This can be a region for ENTERPRISE tier instances.
description String
A description of the snapshot with 2048 characters or less. Requests with longer descriptions will be rejected.
labels Map<String>

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.

name Changes to this property will trigger replacement. String
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 a-z? 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.
project Changes to this property will trigger replacement. String
The ID of the project in which the resource belongs. If it is not provided, the provider project is used.

Outputs

All input properties are implicitly available as output properties. Additionally, the Snapshot resource produces the following output properties:

CreateTime string
The time when the snapshot was created in RFC3339 text format.
EffectiveLabels Dictionary<string, string>
All of labels (key/value pairs) present on the resource in GCP, including the labels configured through Pulumi, other clients and services.
FilesystemUsedBytes string
The amount of bytes needed to allocate a full copy of the snapshot content.
Id string
The provider-assigned unique ID for this managed resource.
PulumiLabels Dictionary<string, string>
The combination of labels configured directly on the resource and default labels configured on the provider.
State string
The snapshot state.
CreateTime string
The time when the snapshot was created in RFC3339 text format.
EffectiveLabels map[string]string
All of labels (key/value pairs) present on the resource in GCP, including the labels configured through Pulumi, other clients and services.
FilesystemUsedBytes string
The amount of bytes needed to allocate a full copy of the snapshot content.
Id string
The provider-assigned unique ID for this managed resource.
PulumiLabels map[string]string
The combination of labels configured directly on the resource and default labels configured on the provider.
State string
The snapshot state.
createTime String
The time when the snapshot was created in RFC3339 text format.
effectiveLabels Map<String,String>
All of labels (key/value pairs) present on the resource in GCP, including the labels configured through Pulumi, other clients and services.
filesystemUsedBytes String
The amount of bytes needed to allocate a full copy of the snapshot content.
id String
The provider-assigned unique ID for this managed resource.
pulumiLabels Map<String,String>
The combination of labels configured directly on the resource and default labels configured on the provider.
state String
The snapshot state.
createTime string
The time when the snapshot was created in RFC3339 text format.
effectiveLabels {[key: string]: string}
All of labels (key/value pairs) present on the resource in GCP, including the labels configured through Pulumi, other clients and services.
filesystemUsedBytes string
The amount of bytes needed to allocate a full copy of the snapshot content.
id string
The provider-assigned unique ID for this managed resource.
pulumiLabels {[key: string]: string}
The combination of labels configured directly on the resource and default labels configured on the provider.
state string
The snapshot state.
create_time str
The time when the snapshot was created in RFC3339 text format.
effective_labels Mapping[str, str]
All of labels (key/value pairs) present on the resource in GCP, including the labels configured through Pulumi, other clients and services.
filesystem_used_bytes str
The amount of bytes needed to allocate a full copy of the snapshot content.
id str
The provider-assigned unique ID for this managed resource.
pulumi_labels Mapping[str, str]
The combination of labels configured directly on the resource and default labels configured on the provider.
state str
The snapshot state.
createTime String
The time when the snapshot was created in RFC3339 text format.
effectiveLabels Map<String>
All of labels (key/value pairs) present on the resource in GCP, including the labels configured through Pulumi, other clients and services.
filesystemUsedBytes String
The amount of bytes needed to allocate a full copy of the snapshot content.
id String
The provider-assigned unique ID for this managed resource.
pulumiLabels Map<String>
The combination of labels configured directly on the resource and default labels configured on the provider.
state String
The snapshot state.

Look up Existing Snapshot Resource

Get an existing Snapshot resource’s state with the given name, ID, and optional extra properties used to qualify the lookup.

public static get(name: string, id: Input<ID>, state?: SnapshotState, opts?: CustomResourceOptions): Snapshot
@staticmethod
def get(resource_name: str,
        id: str,
        opts: Optional[ResourceOptions] = None,
        create_time: Optional[str] = None,
        description: Optional[str] = None,
        effective_labels: Optional[Mapping[str, str]] = None,
        filesystem_used_bytes: Optional[str] = None,
        instance: Optional[str] = None,
        labels: Optional[Mapping[str, str]] = None,
        location: Optional[str] = None,
        name: Optional[str] = None,
        project: Optional[str] = None,
        pulumi_labels: Optional[Mapping[str, str]] = None,
        state: Optional[str] = None) -> Snapshot
func GetSnapshot(ctx *Context, name string, id IDInput, state *SnapshotState, opts ...ResourceOption) (*Snapshot, error)
public static Snapshot Get(string name, Input<string> id, SnapshotState? state, CustomResourceOptions? opts = null)
public static Snapshot get(String name, Output<String> id, SnapshotState state, CustomResourceOptions options)
Resource lookup is not supported in YAML
name This property is required.
The unique name of the resulting resource.
id This property is required.
The unique provider ID of the resource to lookup.
state
Any extra arguments used during the lookup.
opts
A bag of options that control this resource's behavior.
resource_name This property is required.
The unique name of the resulting resource.
id This property is required.
The unique provider ID of the resource to lookup.
name This property is required.
The unique name of the resulting resource.
id This property is required.
The unique provider ID of the resource to lookup.
state
Any extra arguments used during the lookup.
opts
A bag of options that control this resource's behavior.
name This property is required.
The unique name of the resulting resource.
id This property is required.
The unique provider ID of the resource to lookup.
state
Any extra arguments used during the lookup.
opts
A bag of options that control this resource's behavior.
name This property is required.
The unique name of the resulting resource.
id This property is required.
The unique provider ID of the resource to lookup.
state
Any extra arguments used during the lookup.
opts
A bag of options that control this resource's behavior.
The following state arguments are supported:
CreateTime string
The time when the snapshot was created in RFC3339 text format.
Description string
A description of the snapshot with 2048 characters or less. Requests with longer descriptions will be rejected.
EffectiveLabels Dictionary<string, string>
All of labels (key/value pairs) present on the resource in GCP, including the labels configured through Pulumi, other clients and services.
FilesystemUsedBytes string
The amount of bytes needed to allocate a full copy of the snapshot content.
Instance Changes to this property will trigger replacement. string
The resource name of the filestore instance.


Labels Dictionary<string, string>

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.

Location Changes to this property will trigger replacement. string
The name of the location of the instance. This can be a region for ENTERPRISE tier instances.
Name Changes to this property will trigger replacement. string
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 a-z? 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.
Project Changes to this property will trigger replacement. string
The ID of the project in which the resource belongs. If it is not provided, the provider project is used.
PulumiLabels Dictionary<string, string>
The combination of labels configured directly on the resource and default labels configured on the provider.
State string
The snapshot state.
CreateTime string
The time when the snapshot was created in RFC3339 text format.
Description string
A description of the snapshot with 2048 characters or less. Requests with longer descriptions will be rejected.
EffectiveLabels map[string]string
All of labels (key/value pairs) present on the resource in GCP, including the labels configured through Pulumi, other clients and services.
FilesystemUsedBytes string
The amount of bytes needed to allocate a full copy of the snapshot content.
Instance Changes to this property will trigger replacement. string
The resource name of the filestore instance.


Labels map[string]string

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.

Location Changes to this property will trigger replacement. string
The name of the location of the instance. This can be a region for ENTERPRISE tier instances.
Name Changes to this property will trigger replacement. string
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 a-z? 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.
Project Changes to this property will trigger replacement. string
The ID of the project in which the resource belongs. If it is not provided, the provider project is used.
PulumiLabels map[string]string
The combination of labels configured directly on the resource and default labels configured on the provider.
State string
The snapshot state.
createTime String
The time when the snapshot was created in RFC3339 text format.
description String
A description of the snapshot with 2048 characters or less. Requests with longer descriptions will be rejected.
effectiveLabels Map<String,String>
All of labels (key/value pairs) present on the resource in GCP, including the labels configured through Pulumi, other clients and services.
filesystemUsedBytes String
The amount of bytes needed to allocate a full copy of the snapshot content.
instance Changes to this property will trigger replacement. String
The resource name of the filestore instance.


labels Map<String,String>

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.

location Changes to this property will trigger replacement. String
The name of the location of the instance. This can be a region for ENTERPRISE tier instances.
name Changes to this property will trigger replacement. String
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 a-z? 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.
project Changes to this property will trigger replacement. String
The ID of the project in which the resource belongs. If it is not provided, the provider project is used.
pulumiLabels Map<String,String>
The combination of labels configured directly on the resource and default labels configured on the provider.
state String
The snapshot state.
createTime string
The time when the snapshot was created in RFC3339 text format.
description string
A description of the snapshot with 2048 characters or less. Requests with longer descriptions will be rejected.
effectiveLabels {[key: string]: string}
All of labels (key/value pairs) present on the resource in GCP, including the labels configured through Pulumi, other clients and services.
filesystemUsedBytes string
The amount of bytes needed to allocate a full copy of the snapshot content.
instance Changes to this property will trigger replacement. string
The resource name of the filestore instance.


labels {[key: string]: string}

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.

location Changes to this property will trigger replacement. string
The name of the location of the instance. This can be a region for ENTERPRISE tier instances.
name Changes to this property will trigger replacement. string
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 a-z? 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.
project Changes to this property will trigger replacement. string
The ID of the project in which the resource belongs. If it is not provided, the provider project is used.
pulumiLabels {[key: string]: string}
The combination of labels configured directly on the resource and default labels configured on the provider.
state string
The snapshot state.
create_time str
The time when the snapshot was created in RFC3339 text format.
description str
A description of the snapshot with 2048 characters or less. Requests with longer descriptions will be rejected.
effective_labels Mapping[str, str]
All of labels (key/value pairs) present on the resource in GCP, including the labels configured through Pulumi, other clients and services.
filesystem_used_bytes str
The amount of bytes needed to allocate a full copy of the snapshot content.
instance Changes to this property will trigger replacement. str
The resource name of the filestore instance.


labels Mapping[str, str]

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.

location Changes to this property will trigger replacement. str
The name of the location of the instance. This can be a region for ENTERPRISE tier instances.
name Changes to this property will trigger replacement. str
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 a-z? 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.
project Changes to this property will trigger replacement. str
The ID of the project in which the resource belongs. If it is not provided, the provider project is used.
pulumi_labels Mapping[str, str]
The combination of labels configured directly on the resource and default labels configured on the provider.
state str
The snapshot state.
createTime String
The time when the snapshot was created in RFC3339 text format.
description String
A description of the snapshot with 2048 characters or less. Requests with longer descriptions will be rejected.
effectiveLabels Map<String>
All of labels (key/value pairs) present on the resource in GCP, including the labels configured through Pulumi, other clients and services.
filesystemUsedBytes String
The amount of bytes needed to allocate a full copy of the snapshot content.
instance Changes to this property will trigger replacement. String
The resource name of the filestore instance.


labels Map<String>

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.

location Changes to this property will trigger replacement. String
The name of the location of the instance. This can be a region for ENTERPRISE tier instances.
name Changes to this property will trigger replacement. String
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 a-z? 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.
project Changes to this property will trigger replacement. String
The ID of the project in which the resource belongs. If it is not provided, the provider project is used.
pulumiLabels Map<String>
The combination of labels configured directly on the resource and default labels configured on the provider.
state String
The snapshot state.

Import

Snapshot can be imported using any of these accepted formats:

  • projects/{{project}}/locations/{{location}}/instances/{{instance}}/snapshots/{{name}}

  • {{project}}/{{location}}/{{instance}}/{{name}}

  • {{location}}/{{instance}}/{{name}}

When using the pulumi import command, Snapshot can be imported using one of the formats above. For example:

$ pulumi import gcp:filestore/snapshot:Snapshot default projects/{{project}}/locations/{{location}}/instances/{{instance}}/snapshots/{{name}}
Copy
$ pulumi import gcp:filestore/snapshot:Snapshot default {{project}}/{{location}}/{{instance}}/{{name}}
Copy
$ pulumi import gcp:filestore/snapshot:Snapshot default {{location}}/{{instance}}/{{name}}
Copy

To learn more about importing existing cloud resources, see Importing resources.

Package Details

Repository
Google Cloud (GCP) Classic pulumi/pulumi-gcp
License
Apache-2.0
Notes
This Pulumi package is based on the google-beta Terraform Provider.