Instant Snapshot Args
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:
How-to Guides
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 thepulumi 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
Properties
An optional description of this resource.
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.
A reference to the disk used to create this instant snapshot.