InstantSnapshotArgs

data class InstantSnapshotArgs(val description: Output<String>? = null, val labels: Output<Map<String, String>>? = null, val name: Output<String>? = null, val project: Output<String>? = null, val sourceDisk: Output<String>? = null, val zone: Output<String>? = null) : ConvertibleToJava<InstantSnapshotArgs>

Represents an instant snapshot resource. An instant snapshot is an in-place backup of a disk that can be used to rapidly create a new disk in minutes. Instant snapshots capture data at a specific point in time. They are optimized for rapidly restoring captured data to a new disk. Use instant snapshots to quickly recover data in cases where the zone and disk are still intact but the data on the disk has been lost or corrupted To get more information about InstantSnapshot, see:

Example Usage

Instant Snapshot Basic

import * as pulumi from "@pulumi/pulumi";
import * as gcp from "@pulumi/gcp";
const foo = new gcp.compute.Disk("foo", {
name: "example-disk",
type: "pd-ssd",
size: 10,
});
const _default = new gcp.compute.InstantSnapshot("default", {
name: "instant-snapshot",
zone: "us-central1-a",
sourceDisk: foo.selfLink,
});
import pulumi
import pulumi_gcp as gcp
foo = gcp.compute.Disk("foo",
name="example-disk",
type="pd-ssd",
size=10)
default = gcp.compute.InstantSnapshot("default",
name="instant-snapshot",
zone="us-central1-a",
source_disk=foo.self_link)
using System.Collections.Generic;
using System.Linq;
using Pulumi;
using Gcp = Pulumi.Gcp;
return await Deployment.RunAsync(() =>
{
var foo = new Gcp.Compute.Disk("foo", new()
{
Name = "example-disk",
Type = "pd-ssd",
Size = 10,
});
var @default = new Gcp.Compute.InstantSnapshot("default", new()
{
Name = "instant-snapshot",
Zone = "us-central1-a",
SourceDisk = foo.SelfLink,
});
});
package main
import (
"github.com/pulumi/pulumi-gcp/sdk/v8/go/gcp/compute"
"github.com/pulumi/pulumi/sdk/v3/go/pulumi"
)
func main() {
pulumi.Run(func(ctx *pulumi.Context) error {
foo, err := compute.NewDisk(ctx, "foo", &compute.DiskArgs{
Name: pulumi.String("example-disk"),
Type: pulumi.String("pd-ssd"),
Size: pulumi.Int(10),
})
if err != nil {
return err
}
_, err = compute.NewInstantSnapshot(ctx, "default", &compute.InstantSnapshotArgs{
Name: pulumi.String("instant-snapshot"),
Zone: pulumi.String("us-central1-a"),
SourceDisk: foo.SelfLink,
})
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.compute.Disk;
import com.pulumi.gcp.compute.DiskArgs;
import com.pulumi.gcp.compute.InstantSnapshot;
import com.pulumi.gcp.compute.InstantSnapshotArgs;
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 foo = new Disk("foo", DiskArgs.builder()
.name("example-disk")
.type("pd-ssd")
.size(10)
.build());
var default_ = new InstantSnapshot("default", InstantSnapshotArgs.builder()
.name("instant-snapshot")
.zone("us-central1-a")
.sourceDisk(foo.selfLink())
.build());
}
}
resources:
foo:
type: gcp:compute:Disk
properties:
name: example-disk
type: pd-ssd
size: 10
default:
type: gcp:compute:InstantSnapshot
properties:
name: instant-snapshot
zone: us-central1-a
sourceDisk: ${foo.selfLink}

Import

InstantSnapshot can be imported using any of these accepted formats:

  • projects/{{project}}/zones/{{zone}}/instantSnapshots/{{name}}

  • {{project}}/{{zone}}/{{name}}

  • {{zone}}/{{name}}

  • {{name}} When using the pulumi import command, InstantSnapshot can be imported using one of the formats above. For example:

$ pulumi import gcp:compute/instantSnapshot:InstantSnapshot default projects/{{project}}/zones/{{zone}}/instantSnapshots/{{name}}
$ pulumi import gcp:compute/instantSnapshot:InstantSnapshot default {{project}}/{{zone}}/{{name}}
$ pulumi import gcp:compute/instantSnapshot:InstantSnapshot default {{zone}}/{{name}}
$ pulumi import gcp:compute/instantSnapshot:InstantSnapshot default {{name}}

Constructors

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

Properties

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

An optional description of this resource.

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

Labels to apply to this InstantSnapshot. 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 name: Output<String>? = null

Name of the resource; provided by the client when the resource is created. 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.

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

A reference to the disk used to create this instant snapshot.

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

A reference to the zone where the disk is located.

Functions

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