SnapshotArgs

data class SnapshotArgs(val description: Output<String>? = null, val instance: Output<String>? = null, val labels: Output<Map<String, String>>? = null, val location: Output<String>? = null, val name: Output<String>? = null, val project: Output<String>? = null) : ConvertibleToJava<SnapshotArgs>

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",
});
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")
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",
});
});
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
})
}
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());
}
}
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

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",
},
});
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",
})
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" },
},
});
});
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
})
}
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());
}
}
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

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}}
$ pulumi import gcp:filestore/snapshot:Snapshot default {{project}}/{{location}}/{{instance}}/{{name}}
$ pulumi import gcp:filestore/snapshot:Snapshot default {{location}}/{{instance}}/{{name}}

Constructors

Link copied to clipboard
constructor(description: Output<String>? = null, instance: Output<String>? = null, labels: Output<Map<String, String>>? = null, location: Output<String>? = null, name: Output<String>? = null, project: Output<String>? = null)

Properties

Link copied to clipboard
val description: Output<String>? = null

A description of the snapshot with 2048 characters or less. Requests with longer descriptions will be rejected.

Link copied to clipboard
val instance: Output<String>? = null

The resource name of the filestore instance.

Link copied to clipboard
val labels: Output<Map<String, String>>? = null

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.

Link copied to clipboard
val location: Output<String>? = null

The name of the location of the instance. This can be a region for ENTERPRISE tier instances.

Link copied to clipboard
val name: Output<String>? = null

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.

Link copied to clipboard
val project: Output<String>? = null

The ID of the project in which the resource belongs. If it is not provided, the provider project is used.

Functions

Link copied to clipboard
open override fun toJava(): SnapshotArgs