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

gcp.compute.Snapshot

Explore with Pulumi AI

Represents a Persistent Disk Snapshot resource.

Use snapshots to back up data from your persistent disks. Snapshots are different from public images and custom images, which are used primarily to create instances or configure instance templates. Snapshots are useful for periodic backup of the data on your persistent disks. You can create snapshots from persistent disks even while they are attached to running instances.

Snapshots are incremental, so you can create regular snapshots on a persistent disk faster and at a much lower cost than if you regularly created a full image of the disk.

To get more information about Snapshot, see:

Example Usage

Snapshot Basic

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

const debian = gcp.compute.getImage({
    family: "debian-11",
    project: "debian-cloud",
});
const persistent = new gcp.compute.Disk("persistent", {
    name: "debian-disk",
    image: debian.then(debian => debian.selfLink),
    size: 10,
    type: "pd-ssd",
    zone: "us-central1-a",
});
const snapshot = new gcp.compute.Snapshot("snapshot", {
    name: "my-snapshot",
    sourceDisk: persistent.id,
    zone: "us-central1-a",
    labels: {
        my_label: "value",
    },
    storageLocations: ["us-central1"],
});
Copy
import pulumi
import pulumi_gcp as gcp

debian = gcp.compute.get_image(family="debian-11",
    project="debian-cloud")
persistent = gcp.compute.Disk("persistent",
    name="debian-disk",
    image=debian.self_link,
    size=10,
    type="pd-ssd",
    zone="us-central1-a")
snapshot = gcp.compute.Snapshot("snapshot",
    name="my-snapshot",
    source_disk=persistent.id,
    zone="us-central1-a",
    labels={
        "my_label": "value",
    },
    storage_locations=["us-central1"])
Copy
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 {
		debian, err := compute.LookupImage(ctx, &compute.LookupImageArgs{
			Family:  pulumi.StringRef("debian-11"),
			Project: pulumi.StringRef("debian-cloud"),
		}, nil)
		if err != nil {
			return err
		}
		persistent, err := compute.NewDisk(ctx, "persistent", &compute.DiskArgs{
			Name:  pulumi.String("debian-disk"),
			Image: pulumi.String(debian.SelfLink),
			Size:  pulumi.Int(10),
			Type:  pulumi.String("pd-ssd"),
			Zone:  pulumi.String("us-central1-a"),
		})
		if err != nil {
			return err
		}
		_, err = compute.NewSnapshot(ctx, "snapshot", &compute.SnapshotArgs{
			Name:       pulumi.String("my-snapshot"),
			SourceDisk: persistent.ID(),
			Zone:       pulumi.String("us-central1-a"),
			Labels: pulumi.StringMap{
				"my_label": pulumi.String("value"),
			},
			StorageLocations: pulumi.StringArray{
				pulumi.String("us-central1"),
			},
		})
		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 debian = Gcp.Compute.GetImage.Invoke(new()
    {
        Family = "debian-11",
        Project = "debian-cloud",
    });

    var persistent = new Gcp.Compute.Disk("persistent", new()
    {
        Name = "debian-disk",
        Image = debian.Apply(getImageResult => getImageResult.SelfLink),
        Size = 10,
        Type = "pd-ssd",
        Zone = "us-central1-a",
    });

    var snapshot = new Gcp.Compute.Snapshot("snapshot", new()
    {
        Name = "my-snapshot",
        SourceDisk = persistent.Id,
        Zone = "us-central1-a",
        Labels = 
        {
            { "my_label", "value" },
        },
        StorageLocations = new[]
        {
            "us-central1",
        },
    });

});
Copy
package generated_program;

import com.pulumi.Context;
import com.pulumi.Pulumi;
import com.pulumi.core.Output;
import com.pulumi.gcp.compute.ComputeFunctions;
import com.pulumi.gcp.compute.inputs.GetImageArgs;
import com.pulumi.gcp.compute.Disk;
import com.pulumi.gcp.compute.DiskArgs;
import com.pulumi.gcp.compute.Snapshot;
import com.pulumi.gcp.compute.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) {
        final var debian = ComputeFunctions.getImage(GetImageArgs.builder()
            .family("debian-11")
            .project("debian-cloud")
            .build());

        var persistent = new Disk("persistent", DiskArgs.builder()
            .name("debian-disk")
            .image(debian.applyValue(getImageResult -> getImageResult.selfLink()))
            .size(10)
            .type("pd-ssd")
            .zone("us-central1-a")
            .build());

        var snapshot = new Snapshot("snapshot", SnapshotArgs.builder()
            .name("my-snapshot")
            .sourceDisk(persistent.id())
            .zone("us-central1-a")
            .labels(Map.of("my_label", "value"))
            .storageLocations("us-central1")
            .build());

    }
}
Copy
resources:
  snapshot:
    type: gcp:compute:Snapshot
    properties:
      name: my-snapshot
      sourceDisk: ${persistent.id}
      zone: us-central1-a
      labels:
        my_label: value
      storageLocations:
        - us-central1
  persistent:
    type: gcp:compute:Disk
    properties:
      name: debian-disk
      image: ${debian.selfLink}
      size: 10
      type: pd-ssd
      zone: us-central1-a
variables:
  debian:
    fn::invoke:
      function: gcp:compute:getImage
      arguments:
        family: debian-11
        project: debian-cloud
Copy

Snapshot Chainname

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

const debian = gcp.compute.getImage({
    family: "debian-11",
    project: "debian-cloud",
});
const persistent = new gcp.compute.Disk("persistent", {
    name: "debian-disk",
    image: debian.then(debian => debian.selfLink),
    size: 10,
    type: "pd-ssd",
    zone: "us-central1-a",
});
const snapshot = new gcp.compute.Snapshot("snapshot", {
    name: "my-snapshot",
    sourceDisk: persistent.id,
    zone: "us-central1-a",
    chainName: "snapshot-chain",
    labels: {
        my_label: "value",
    },
    storageLocations: ["us-central1"],
});
Copy
import pulumi
import pulumi_gcp as gcp

debian = gcp.compute.get_image(family="debian-11",
    project="debian-cloud")
persistent = gcp.compute.Disk("persistent",
    name="debian-disk",
    image=debian.self_link,
    size=10,
    type="pd-ssd",
    zone="us-central1-a")
snapshot = gcp.compute.Snapshot("snapshot",
    name="my-snapshot",
    source_disk=persistent.id,
    zone="us-central1-a",
    chain_name="snapshot-chain",
    labels={
        "my_label": "value",
    },
    storage_locations=["us-central1"])
Copy
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 {
		debian, err := compute.LookupImage(ctx, &compute.LookupImageArgs{
			Family:  pulumi.StringRef("debian-11"),
			Project: pulumi.StringRef("debian-cloud"),
		}, nil)
		if err != nil {
			return err
		}
		persistent, err := compute.NewDisk(ctx, "persistent", &compute.DiskArgs{
			Name:  pulumi.String("debian-disk"),
			Image: pulumi.String(debian.SelfLink),
			Size:  pulumi.Int(10),
			Type:  pulumi.String("pd-ssd"),
			Zone:  pulumi.String("us-central1-a"),
		})
		if err != nil {
			return err
		}
		_, err = compute.NewSnapshot(ctx, "snapshot", &compute.SnapshotArgs{
			Name:       pulumi.String("my-snapshot"),
			SourceDisk: persistent.ID(),
			Zone:       pulumi.String("us-central1-a"),
			ChainName:  pulumi.String("snapshot-chain"),
			Labels: pulumi.StringMap{
				"my_label": pulumi.String("value"),
			},
			StorageLocations: pulumi.StringArray{
				pulumi.String("us-central1"),
			},
		})
		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 debian = Gcp.Compute.GetImage.Invoke(new()
    {
        Family = "debian-11",
        Project = "debian-cloud",
    });

    var persistent = new Gcp.Compute.Disk("persistent", new()
    {
        Name = "debian-disk",
        Image = debian.Apply(getImageResult => getImageResult.SelfLink),
        Size = 10,
        Type = "pd-ssd",
        Zone = "us-central1-a",
    });

    var snapshot = new Gcp.Compute.Snapshot("snapshot", new()
    {
        Name = "my-snapshot",
        SourceDisk = persistent.Id,
        Zone = "us-central1-a",
        ChainName = "snapshot-chain",
        Labels = 
        {
            { "my_label", "value" },
        },
        StorageLocations = new[]
        {
            "us-central1",
        },
    });

});
Copy
package generated_program;

import com.pulumi.Context;
import com.pulumi.Pulumi;
import com.pulumi.core.Output;
import com.pulumi.gcp.compute.ComputeFunctions;
import com.pulumi.gcp.compute.inputs.GetImageArgs;
import com.pulumi.gcp.compute.Disk;
import com.pulumi.gcp.compute.DiskArgs;
import com.pulumi.gcp.compute.Snapshot;
import com.pulumi.gcp.compute.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) {
        final var debian = ComputeFunctions.getImage(GetImageArgs.builder()
            .family("debian-11")
            .project("debian-cloud")
            .build());

        var persistent = new Disk("persistent", DiskArgs.builder()
            .name("debian-disk")
            .image(debian.applyValue(getImageResult -> getImageResult.selfLink()))
            .size(10)
            .type("pd-ssd")
            .zone("us-central1-a")
            .build());

        var snapshot = new Snapshot("snapshot", SnapshotArgs.builder()
            .name("my-snapshot")
            .sourceDisk(persistent.id())
            .zone("us-central1-a")
            .chainName("snapshot-chain")
            .labels(Map.of("my_label", "value"))
            .storageLocations("us-central1")
            .build());

    }
}
Copy
resources:
  snapshot:
    type: gcp:compute:Snapshot
    properties:
      name: my-snapshot
      sourceDisk: ${persistent.id}
      zone: us-central1-a
      chainName: snapshot-chain
      labels:
        my_label: value
      storageLocations:
        - us-central1
  persistent:
    type: gcp:compute:Disk
    properties:
      name: debian-disk
      image: ${debian.selfLink}
      size: 10
      type: pd-ssd
      zone: us-central1-a
variables:
  debian:
    fn::invoke:
      function: gcp:compute:getImage
      arguments:
        family: debian-11
        project: debian-cloud
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,
             source_disk: Optional[str] = None,
             chain_name: Optional[str] = None,
             description: Optional[str] = None,
             labels: Optional[Mapping[str, str]] = None,
             name: Optional[str] = None,
             project: Optional[str] = None,
             snapshot_encryption_key: Optional[SnapshotSnapshotEncryptionKeyArgs] = None,
             source_disk_encryption_key: Optional[SnapshotSourceDiskEncryptionKeyArgs] = None,
             storage_locations: Optional[Sequence[str]] = None,
             zone: 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:compute: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 snapshotResource = new Gcp.Compute.Snapshot("snapshotResource", new()
{
    SourceDisk = "string",
    ChainName = "string",
    Description = "string",
    Labels = 
    {
        { "string", "string" },
    },
    Name = "string",
    Project = "string",
    SnapshotEncryptionKey = new Gcp.Compute.Inputs.SnapshotSnapshotEncryptionKeyArgs
    {
        KmsKeySelfLink = "string",
        KmsKeyServiceAccount = "string",
        RawKey = "string",
        Sha256 = "string",
    },
    SourceDiskEncryptionKey = new Gcp.Compute.Inputs.SnapshotSourceDiskEncryptionKeyArgs
    {
        KmsKeyServiceAccount = "string",
        RawKey = "string",
    },
    StorageLocations = new[]
    {
        "string",
    },
    Zone = "string",
});
Copy
example, err := compute.NewSnapshot(ctx, "snapshotResource", &compute.SnapshotArgs{
	SourceDisk:  pulumi.String("string"),
	ChainName:   pulumi.String("string"),
	Description: pulumi.String("string"),
	Labels: pulumi.StringMap{
		"string": pulumi.String("string"),
	},
	Name:    pulumi.String("string"),
	Project: pulumi.String("string"),
	SnapshotEncryptionKey: &compute.SnapshotSnapshotEncryptionKeyArgs{
		KmsKeySelfLink:       pulumi.String("string"),
		KmsKeyServiceAccount: pulumi.String("string"),
		RawKey:               pulumi.String("string"),
		Sha256:               pulumi.String("string"),
	},
	SourceDiskEncryptionKey: &compute.SnapshotSourceDiskEncryptionKeyArgs{
		KmsKeyServiceAccount: pulumi.String("string"),
		RawKey:               pulumi.String("string"),
	},
	StorageLocations: pulumi.StringArray{
		pulumi.String("string"),
	},
	Zone: pulumi.String("string"),
})
Copy
var snapshotResource = new Snapshot("snapshotResource", SnapshotArgs.builder()
    .sourceDisk("string")
    .chainName("string")
    .description("string")
    .labels(Map.of("string", "string"))
    .name("string")
    .project("string")
    .snapshotEncryptionKey(SnapshotSnapshotEncryptionKeyArgs.builder()
        .kmsKeySelfLink("string")
        .kmsKeyServiceAccount("string")
        .rawKey("string")
        .sha256("string")
        .build())
    .sourceDiskEncryptionKey(SnapshotSourceDiskEncryptionKeyArgs.builder()
        .kmsKeyServiceAccount("string")
        .rawKey("string")
        .build())
    .storageLocations("string")
    .zone("string")
    .build());
Copy
snapshot_resource = gcp.compute.Snapshot("snapshotResource",
    source_disk="string",
    chain_name="string",
    description="string",
    labels={
        "string": "string",
    },
    name="string",
    project="string",
    snapshot_encryption_key={
        "kms_key_self_link": "string",
        "kms_key_service_account": "string",
        "raw_key": "string",
        "sha256": "string",
    },
    source_disk_encryption_key={
        "kms_key_service_account": "string",
        "raw_key": "string",
    },
    storage_locations=["string"],
    zone="string")
Copy
const snapshotResource = new gcp.compute.Snapshot("snapshotResource", {
    sourceDisk: "string",
    chainName: "string",
    description: "string",
    labels: {
        string: "string",
    },
    name: "string",
    project: "string",
    snapshotEncryptionKey: {
        kmsKeySelfLink: "string",
        kmsKeyServiceAccount: "string",
        rawKey: "string",
        sha256: "string",
    },
    sourceDiskEncryptionKey: {
        kmsKeyServiceAccount: "string",
        rawKey: "string",
    },
    storageLocations: ["string"],
    zone: "string",
});
Copy
type: gcp:compute:Snapshot
properties:
    chainName: string
    description: string
    labels:
        string: string
    name: string
    project: string
    snapshotEncryptionKey:
        kmsKeySelfLink: string
        kmsKeyServiceAccount: string
        rawKey: string
        sha256: string
    sourceDisk: string
    sourceDiskEncryptionKey:
        kmsKeyServiceAccount: string
        rawKey: string
    storageLocations:
        - string
    zone: 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:

SourceDisk
This property is required.
Changes to this property will trigger replacement.
string
A reference to the disk used to create this snapshot.


ChainName Changes to this property will trigger replacement. string
Creates the new snapshot in the snapshot chain labeled with the specified name. The chain name must be 1-63 characters long and comply with RFC1035. This is an uncommon option only for advanced service owners who needs to create separate snapshot chains, for example, for chargeback tracking. When you describe your snapshot resource, this field is visible only if it has a non-empty value.
Description Changes to this property will trigger replacement. string
An optional description of this resource.
Labels Dictionary<string, string>
Labels to apply to this Snapshot. 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
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.
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.
SnapshotEncryptionKey Changes to this property will trigger replacement. SnapshotSnapshotEncryptionKey
Encrypts the snapshot using a customer-supplied encryption key. After you encrypt a snapshot using a customer-supplied key, you must provide the same key if you use the snapshot later. For example, you must provide the encryption key when you create a disk from the encrypted snapshot in a future request. Customer-supplied encryption keys do not protect access to metadata of the snapshot. If you do not provide an encryption key when creating the snapshot, then the snapshot will be encrypted using an automatically generated key and you do not need to provide a key to use the snapshot later. Structure is documented below.
SourceDiskEncryptionKey Changes to this property will trigger replacement. SnapshotSourceDiskEncryptionKey
The customer-supplied encryption key of the source snapshot. Required if the source snapshot is protected by a customer-supplied encryption key. Structure is documented below.
StorageLocations Changes to this property will trigger replacement. List<string>
Cloud Storage bucket storage location of the snapshot (regional or multi-regional).
Zone Changes to this property will trigger replacement. string
A reference to the zone where the disk is hosted.
SourceDisk
This property is required.
Changes to this property will trigger replacement.
string
A reference to the disk used to create this snapshot.


ChainName Changes to this property will trigger replacement. string
Creates the new snapshot in the snapshot chain labeled with the specified name. The chain name must be 1-63 characters long and comply with RFC1035. This is an uncommon option only for advanced service owners who needs to create separate snapshot chains, for example, for chargeback tracking. When you describe your snapshot resource, this field is visible only if it has a non-empty value.
Description Changes to this property will trigger replacement. string
An optional description of this resource.
Labels map[string]string
Labels to apply to this Snapshot. 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
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.
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.
SnapshotEncryptionKey Changes to this property will trigger replacement. SnapshotSnapshotEncryptionKeyArgs
Encrypts the snapshot using a customer-supplied encryption key. After you encrypt a snapshot using a customer-supplied key, you must provide the same key if you use the snapshot later. For example, you must provide the encryption key when you create a disk from the encrypted snapshot in a future request. Customer-supplied encryption keys do not protect access to metadata of the snapshot. If you do not provide an encryption key when creating the snapshot, then the snapshot will be encrypted using an automatically generated key and you do not need to provide a key to use the snapshot later. Structure is documented below.
SourceDiskEncryptionKey Changes to this property will trigger replacement. SnapshotSourceDiskEncryptionKeyArgs
The customer-supplied encryption key of the source snapshot. Required if the source snapshot is protected by a customer-supplied encryption key. Structure is documented below.
StorageLocations Changes to this property will trigger replacement. []string
Cloud Storage bucket storage location of the snapshot (regional or multi-regional).
Zone Changes to this property will trigger replacement. string
A reference to the zone where the disk is hosted.
sourceDisk
This property is required.
Changes to this property will trigger replacement.
String
A reference to the disk used to create this snapshot.


chainName Changes to this property will trigger replacement. String
Creates the new snapshot in the snapshot chain labeled with the specified name. The chain name must be 1-63 characters long and comply with RFC1035. This is an uncommon option only for advanced service owners who needs to create separate snapshot chains, for example, for chargeback tracking. When you describe your snapshot resource, this field is visible only if it has a non-empty value.
description Changes to this property will trigger replacement. String
An optional description of this resource.
labels Map<String,String>
Labels to apply to this Snapshot. 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
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.
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.
snapshotEncryptionKey Changes to this property will trigger replacement. SnapshotSnapshotEncryptionKey
Encrypts the snapshot using a customer-supplied encryption key. After you encrypt a snapshot using a customer-supplied key, you must provide the same key if you use the snapshot later. For example, you must provide the encryption key when you create a disk from the encrypted snapshot in a future request. Customer-supplied encryption keys do not protect access to metadata of the snapshot. If you do not provide an encryption key when creating the snapshot, then the snapshot will be encrypted using an automatically generated key and you do not need to provide a key to use the snapshot later. Structure is documented below.
sourceDiskEncryptionKey Changes to this property will trigger replacement. SnapshotSourceDiskEncryptionKey
The customer-supplied encryption key of the source snapshot. Required if the source snapshot is protected by a customer-supplied encryption key. Structure is documented below.
storageLocations Changes to this property will trigger replacement. List<String>
Cloud Storage bucket storage location of the snapshot (regional or multi-regional).
zone Changes to this property will trigger replacement. String
A reference to the zone where the disk is hosted.
sourceDisk
This property is required.
Changes to this property will trigger replacement.
string
A reference to the disk used to create this snapshot.


chainName Changes to this property will trigger replacement. string
Creates the new snapshot in the snapshot chain labeled with the specified name. The chain name must be 1-63 characters long and comply with RFC1035. This is an uncommon option only for advanced service owners who needs to create separate snapshot chains, for example, for chargeback tracking. When you describe your snapshot resource, this field is visible only if it has a non-empty value.
description Changes to this property will trigger replacement. string
An optional description of this resource.
labels {[key: string]: string}
Labels to apply to this Snapshot. 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
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.
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.
snapshotEncryptionKey Changes to this property will trigger replacement. SnapshotSnapshotEncryptionKey
Encrypts the snapshot using a customer-supplied encryption key. After you encrypt a snapshot using a customer-supplied key, you must provide the same key if you use the snapshot later. For example, you must provide the encryption key when you create a disk from the encrypted snapshot in a future request. Customer-supplied encryption keys do not protect access to metadata of the snapshot. If you do not provide an encryption key when creating the snapshot, then the snapshot will be encrypted using an automatically generated key and you do not need to provide a key to use the snapshot later. Structure is documented below.
sourceDiskEncryptionKey Changes to this property will trigger replacement. SnapshotSourceDiskEncryptionKey
The customer-supplied encryption key of the source snapshot. Required if the source snapshot is protected by a customer-supplied encryption key. Structure is documented below.
storageLocations Changes to this property will trigger replacement. string[]
Cloud Storage bucket storage location of the snapshot (regional or multi-regional).
zone Changes to this property will trigger replacement. string
A reference to the zone where the disk is hosted.
source_disk
This property is required.
Changes to this property will trigger replacement.
str
A reference to the disk used to create this snapshot.


chain_name Changes to this property will trigger replacement. str
Creates the new snapshot in the snapshot chain labeled with the specified name. The chain name must be 1-63 characters long and comply with RFC1035. This is an uncommon option only for advanced service owners who needs to create separate snapshot chains, for example, for chargeback tracking. When you describe your snapshot resource, this field is visible only if it has a non-empty value.
description Changes to this property will trigger replacement. str
An optional description of this resource.
labels Mapping[str, str]
Labels to apply to this Snapshot. 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
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.
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.
snapshot_encryption_key Changes to this property will trigger replacement. SnapshotSnapshotEncryptionKeyArgs
Encrypts the snapshot using a customer-supplied encryption key. After you encrypt a snapshot using a customer-supplied key, you must provide the same key if you use the snapshot later. For example, you must provide the encryption key when you create a disk from the encrypted snapshot in a future request. Customer-supplied encryption keys do not protect access to metadata of the snapshot. If you do not provide an encryption key when creating the snapshot, then the snapshot will be encrypted using an automatically generated key and you do not need to provide a key to use the snapshot later. Structure is documented below.
source_disk_encryption_key Changes to this property will trigger replacement. SnapshotSourceDiskEncryptionKeyArgs
The customer-supplied encryption key of the source snapshot. Required if the source snapshot is protected by a customer-supplied encryption key. Structure is documented below.
storage_locations Changes to this property will trigger replacement. Sequence[str]
Cloud Storage bucket storage location of the snapshot (regional or multi-regional).
zone Changes to this property will trigger replacement. str
A reference to the zone where the disk is hosted.
sourceDisk
This property is required.
Changes to this property will trigger replacement.
String
A reference to the disk used to create this snapshot.


chainName Changes to this property will trigger replacement. String
Creates the new snapshot in the snapshot chain labeled with the specified name. The chain name must be 1-63 characters long and comply with RFC1035. This is an uncommon option only for advanced service owners who needs to create separate snapshot chains, for example, for chargeback tracking. When you describe your snapshot resource, this field is visible only if it has a non-empty value.
description Changes to this property will trigger replacement. String
An optional description of this resource.
labels Map<String>
Labels to apply to this Snapshot. 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
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.
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.
snapshotEncryptionKey Changes to this property will trigger replacement. Property Map
Encrypts the snapshot using a customer-supplied encryption key. After you encrypt a snapshot using a customer-supplied key, you must provide the same key if you use the snapshot later. For example, you must provide the encryption key when you create a disk from the encrypted snapshot in a future request. Customer-supplied encryption keys do not protect access to metadata of the snapshot. If you do not provide an encryption key when creating the snapshot, then the snapshot will be encrypted using an automatically generated key and you do not need to provide a key to use the snapshot later. Structure is documented below.
sourceDiskEncryptionKey Changes to this property will trigger replacement. Property Map
The customer-supplied encryption key of the source snapshot. Required if the source snapshot is protected by a customer-supplied encryption key. Structure is documented below.
storageLocations Changes to this property will trigger replacement. List<String>
Cloud Storage bucket storage location of the snapshot (regional or multi-regional).
zone Changes to this property will trigger replacement. String
A reference to the zone where the disk is hosted.

Outputs

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

CreationTimestamp string
Creation timestamp in RFC3339 text format.
DiskSizeGb int
Size of the snapshot, specified in GB.
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.
Id string
The provider-assigned unique ID for this managed resource.
LabelFingerprint string
The fingerprint used for optimistic locking of this resource. Used internally during updates.
Licenses List<string>
A list of public visible licenses that apply to this snapshot. This can be because the original image had licenses attached (such as a Windows image). snapshotEncryptionKey nested object Encrypts the snapshot using a customer-supplied encryption key.
PulumiLabels Dictionary<string, string>
The combination of labels configured directly on the resource and default labels configured on the provider.
SelfLink string
The URI of the created resource.
SnapshotId int
The unique identifier for the resource.
StorageBytes int
A size of the storage used by the snapshot. As snapshots share storage, this number is expected to change with snapshot creation/deletion.
CreationTimestamp string
Creation timestamp in RFC3339 text format.
DiskSizeGb int
Size of the snapshot, specified in GB.
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.
Id string
The provider-assigned unique ID for this managed resource.
LabelFingerprint string
The fingerprint used for optimistic locking of this resource. Used internally during updates.
Licenses []string
A list of public visible licenses that apply to this snapshot. This can be because the original image had licenses attached (such as a Windows image). snapshotEncryptionKey nested object Encrypts the snapshot using a customer-supplied encryption key.
PulumiLabels map[string]string
The combination of labels configured directly on the resource and default labels configured on the provider.
SelfLink string
The URI of the created resource.
SnapshotId int
The unique identifier for the resource.
StorageBytes int
A size of the storage used by the snapshot. As snapshots share storage, this number is expected to change with snapshot creation/deletion.
creationTimestamp String
Creation timestamp in RFC3339 text format.
diskSizeGb Integer
Size of the snapshot, specified in GB.
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.
id String
The provider-assigned unique ID for this managed resource.
labelFingerprint String
The fingerprint used for optimistic locking of this resource. Used internally during updates.
licenses List<String>
A list of public visible licenses that apply to this snapshot. This can be because the original image had licenses attached (such as a Windows image). snapshotEncryptionKey nested object Encrypts the snapshot using a customer-supplied encryption key.
pulumiLabels Map<String,String>
The combination of labels configured directly on the resource and default labels configured on the provider.
selfLink String
The URI of the created resource.
snapshotId Integer
The unique identifier for the resource.
storageBytes Integer
A size of the storage used by the snapshot. As snapshots share storage, this number is expected to change with snapshot creation/deletion.
creationTimestamp string
Creation timestamp in RFC3339 text format.
diskSizeGb number
Size of the snapshot, specified in GB.
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.
id string
The provider-assigned unique ID for this managed resource.
labelFingerprint string
The fingerprint used for optimistic locking of this resource. Used internally during updates.
licenses string[]
A list of public visible licenses that apply to this snapshot. This can be because the original image had licenses attached (such as a Windows image). snapshotEncryptionKey nested object Encrypts the snapshot using a customer-supplied encryption key.
pulumiLabels {[key: string]: string}
The combination of labels configured directly on the resource and default labels configured on the provider.
selfLink string
The URI of the created resource.
snapshotId number
The unique identifier for the resource.
storageBytes number
A size of the storage used by the snapshot. As snapshots share storage, this number is expected to change with snapshot creation/deletion.
creation_timestamp str
Creation timestamp in RFC3339 text format.
disk_size_gb int
Size of the snapshot, specified in GB.
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.
id str
The provider-assigned unique ID for this managed resource.
label_fingerprint str
The fingerprint used for optimistic locking of this resource. Used internally during updates.
licenses Sequence[str]
A list of public visible licenses that apply to this snapshot. This can be because the original image had licenses attached (such as a Windows image). snapshotEncryptionKey nested object Encrypts the snapshot using a customer-supplied encryption key.
pulumi_labels Mapping[str, str]
The combination of labels configured directly on the resource and default labels configured on the provider.
self_link str
The URI of the created resource.
snapshot_id int
The unique identifier for the resource.
storage_bytes int
A size of the storage used by the snapshot. As snapshots share storage, this number is expected to change with snapshot creation/deletion.
creationTimestamp String
Creation timestamp in RFC3339 text format.
diskSizeGb Number
Size of the snapshot, specified in GB.
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.
id String
The provider-assigned unique ID for this managed resource.
labelFingerprint String
The fingerprint used for optimistic locking of this resource. Used internally during updates.
licenses List<String>
A list of public visible licenses that apply to this snapshot. This can be because the original image had licenses attached (such as a Windows image). snapshotEncryptionKey nested object Encrypts the snapshot using a customer-supplied encryption key.
pulumiLabels Map<String>
The combination of labels configured directly on the resource and default labels configured on the provider.
selfLink String
The URI of the created resource.
snapshotId Number
The unique identifier for the resource.
storageBytes Number
A size of the storage used by the snapshot. As snapshots share storage, this number is expected to change with snapshot creation/deletion.

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,
        chain_name: Optional[str] = None,
        creation_timestamp: Optional[str] = None,
        description: Optional[str] = None,
        disk_size_gb: Optional[int] = None,
        effective_labels: Optional[Mapping[str, str]] = None,
        label_fingerprint: Optional[str] = None,
        labels: Optional[Mapping[str, str]] = None,
        licenses: Optional[Sequence[str]] = None,
        name: Optional[str] = None,
        project: Optional[str] = None,
        pulumi_labels: Optional[Mapping[str, str]] = None,
        self_link: Optional[str] = None,
        snapshot_encryption_key: Optional[SnapshotSnapshotEncryptionKeyArgs] = None,
        snapshot_id: Optional[int] = None,
        source_disk: Optional[str] = None,
        source_disk_encryption_key: Optional[SnapshotSourceDiskEncryptionKeyArgs] = None,
        storage_bytes: Optional[int] = None,
        storage_locations: Optional[Sequence[str]] = None,
        zone: 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:
ChainName Changes to this property will trigger replacement. string
Creates the new snapshot in the snapshot chain labeled with the specified name. The chain name must be 1-63 characters long and comply with RFC1035. This is an uncommon option only for advanced service owners who needs to create separate snapshot chains, for example, for chargeback tracking. When you describe your snapshot resource, this field is visible only if it has a non-empty value.
CreationTimestamp string
Creation timestamp in RFC3339 text format.
Description Changes to this property will trigger replacement. string
An optional description of this resource.
DiskSizeGb int
Size of the snapshot, specified in GB.
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.
LabelFingerprint string
The fingerprint used for optimistic locking of this resource. Used internally during updates.
Labels Dictionary<string, string>
Labels to apply to this Snapshot. 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.
Licenses List<string>
A list of public visible licenses that apply to this snapshot. This can be because the original image had licenses attached (such as a Windows image). snapshotEncryptionKey nested object Encrypts the snapshot using a customer-supplied encryption key.
Name Changes to this property will trigger replacement. string
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.
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.
SelfLink string
The URI of the created resource.
SnapshotEncryptionKey Changes to this property will trigger replacement. SnapshotSnapshotEncryptionKey
Encrypts the snapshot using a customer-supplied encryption key. After you encrypt a snapshot using a customer-supplied key, you must provide the same key if you use the snapshot later. For example, you must provide the encryption key when you create a disk from the encrypted snapshot in a future request. Customer-supplied encryption keys do not protect access to metadata of the snapshot. If you do not provide an encryption key when creating the snapshot, then the snapshot will be encrypted using an automatically generated key and you do not need to provide a key to use the snapshot later. Structure is documented below.
SnapshotId int
The unique identifier for the resource.
SourceDisk Changes to this property will trigger replacement. string
A reference to the disk used to create this snapshot.


SourceDiskEncryptionKey Changes to this property will trigger replacement. SnapshotSourceDiskEncryptionKey
The customer-supplied encryption key of the source snapshot. Required if the source snapshot is protected by a customer-supplied encryption key. Structure is documented below.
StorageBytes int
A size of the storage used by the snapshot. As snapshots share storage, this number is expected to change with snapshot creation/deletion.
StorageLocations Changes to this property will trigger replacement. List<string>
Cloud Storage bucket storage location of the snapshot (regional or multi-regional).
Zone Changes to this property will trigger replacement. string
A reference to the zone where the disk is hosted.
ChainName Changes to this property will trigger replacement. string
Creates the new snapshot in the snapshot chain labeled with the specified name. The chain name must be 1-63 characters long and comply with RFC1035. This is an uncommon option only for advanced service owners who needs to create separate snapshot chains, for example, for chargeback tracking. When you describe your snapshot resource, this field is visible only if it has a non-empty value.
CreationTimestamp string
Creation timestamp in RFC3339 text format.
Description Changes to this property will trigger replacement. string
An optional description of this resource.
DiskSizeGb int
Size of the snapshot, specified in GB.
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.
LabelFingerprint string
The fingerprint used for optimistic locking of this resource. Used internally during updates.
Labels map[string]string
Labels to apply to this Snapshot. 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.
Licenses []string
A list of public visible licenses that apply to this snapshot. This can be because the original image had licenses attached (such as a Windows image). snapshotEncryptionKey nested object Encrypts the snapshot using a customer-supplied encryption key.
Name Changes to this property will trigger replacement. string
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.
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.
SelfLink string
The URI of the created resource.
SnapshotEncryptionKey Changes to this property will trigger replacement. SnapshotSnapshotEncryptionKeyArgs
Encrypts the snapshot using a customer-supplied encryption key. After you encrypt a snapshot using a customer-supplied key, you must provide the same key if you use the snapshot later. For example, you must provide the encryption key when you create a disk from the encrypted snapshot in a future request. Customer-supplied encryption keys do not protect access to metadata of the snapshot. If you do not provide an encryption key when creating the snapshot, then the snapshot will be encrypted using an automatically generated key and you do not need to provide a key to use the snapshot later. Structure is documented below.
SnapshotId int
The unique identifier for the resource.
SourceDisk Changes to this property will trigger replacement. string
A reference to the disk used to create this snapshot.


SourceDiskEncryptionKey Changes to this property will trigger replacement. SnapshotSourceDiskEncryptionKeyArgs
The customer-supplied encryption key of the source snapshot. Required if the source snapshot is protected by a customer-supplied encryption key. Structure is documented below.
StorageBytes int
A size of the storage used by the snapshot. As snapshots share storage, this number is expected to change with snapshot creation/deletion.
StorageLocations Changes to this property will trigger replacement. []string
Cloud Storage bucket storage location of the snapshot (regional or multi-regional).
Zone Changes to this property will trigger replacement. string
A reference to the zone where the disk is hosted.
chainName Changes to this property will trigger replacement. String
Creates the new snapshot in the snapshot chain labeled with the specified name. The chain name must be 1-63 characters long and comply with RFC1035. This is an uncommon option only for advanced service owners who needs to create separate snapshot chains, for example, for chargeback tracking. When you describe your snapshot resource, this field is visible only if it has a non-empty value.
creationTimestamp String
Creation timestamp in RFC3339 text format.
description Changes to this property will trigger replacement. String
An optional description of this resource.
diskSizeGb Integer
Size of the snapshot, specified in GB.
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.
labelFingerprint String
The fingerprint used for optimistic locking of this resource. Used internally during updates.
labels Map<String,String>
Labels to apply to this Snapshot. 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.
licenses List<String>
A list of public visible licenses that apply to this snapshot. This can be because the original image had licenses attached (such as a Windows image). snapshotEncryptionKey nested object Encrypts the snapshot using a customer-supplied encryption key.
name Changes to this property will trigger replacement. String
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.
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.
selfLink String
The URI of the created resource.
snapshotEncryptionKey Changes to this property will trigger replacement. SnapshotSnapshotEncryptionKey
Encrypts the snapshot using a customer-supplied encryption key. After you encrypt a snapshot using a customer-supplied key, you must provide the same key if you use the snapshot later. For example, you must provide the encryption key when you create a disk from the encrypted snapshot in a future request. Customer-supplied encryption keys do not protect access to metadata of the snapshot. If you do not provide an encryption key when creating the snapshot, then the snapshot will be encrypted using an automatically generated key and you do not need to provide a key to use the snapshot later. Structure is documented below.
snapshotId Integer
The unique identifier for the resource.
sourceDisk Changes to this property will trigger replacement. String
A reference to the disk used to create this snapshot.


sourceDiskEncryptionKey Changes to this property will trigger replacement. SnapshotSourceDiskEncryptionKey
The customer-supplied encryption key of the source snapshot. Required if the source snapshot is protected by a customer-supplied encryption key. Structure is documented below.
storageBytes Integer
A size of the storage used by the snapshot. As snapshots share storage, this number is expected to change with snapshot creation/deletion.
storageLocations Changes to this property will trigger replacement. List<String>
Cloud Storage bucket storage location of the snapshot (regional or multi-regional).
zone Changes to this property will trigger replacement. String
A reference to the zone where the disk is hosted.
chainName Changes to this property will trigger replacement. string
Creates the new snapshot in the snapshot chain labeled with the specified name. The chain name must be 1-63 characters long and comply with RFC1035. This is an uncommon option only for advanced service owners who needs to create separate snapshot chains, for example, for chargeback tracking. When you describe your snapshot resource, this field is visible only if it has a non-empty value.
creationTimestamp string
Creation timestamp in RFC3339 text format.
description Changes to this property will trigger replacement. string
An optional description of this resource.
diskSizeGb number
Size of the snapshot, specified in GB.
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.
labelFingerprint string
The fingerprint used for optimistic locking of this resource. Used internally during updates.
labels {[key: string]: string}
Labels to apply to this Snapshot. 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.
licenses string[]
A list of public visible licenses that apply to this snapshot. This can be because the original image had licenses attached (such as a Windows image). snapshotEncryptionKey nested object Encrypts the snapshot using a customer-supplied encryption key.
name Changes to this property will trigger replacement. string
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.
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.
selfLink string
The URI of the created resource.
snapshotEncryptionKey Changes to this property will trigger replacement. SnapshotSnapshotEncryptionKey
Encrypts the snapshot using a customer-supplied encryption key. After you encrypt a snapshot using a customer-supplied key, you must provide the same key if you use the snapshot later. For example, you must provide the encryption key when you create a disk from the encrypted snapshot in a future request. Customer-supplied encryption keys do not protect access to metadata of the snapshot. If you do not provide an encryption key when creating the snapshot, then the snapshot will be encrypted using an automatically generated key and you do not need to provide a key to use the snapshot later. Structure is documented below.
snapshotId number
The unique identifier for the resource.
sourceDisk Changes to this property will trigger replacement. string
A reference to the disk used to create this snapshot.


sourceDiskEncryptionKey Changes to this property will trigger replacement. SnapshotSourceDiskEncryptionKey
The customer-supplied encryption key of the source snapshot. Required if the source snapshot is protected by a customer-supplied encryption key. Structure is documented below.
storageBytes number
A size of the storage used by the snapshot. As snapshots share storage, this number is expected to change with snapshot creation/deletion.
storageLocations Changes to this property will trigger replacement. string[]
Cloud Storage bucket storage location of the snapshot (regional or multi-regional).
zone Changes to this property will trigger replacement. string
A reference to the zone where the disk is hosted.
chain_name Changes to this property will trigger replacement. str
Creates the new snapshot in the snapshot chain labeled with the specified name. The chain name must be 1-63 characters long and comply with RFC1035. This is an uncommon option only for advanced service owners who needs to create separate snapshot chains, for example, for chargeback tracking. When you describe your snapshot resource, this field is visible only if it has a non-empty value.
creation_timestamp str
Creation timestamp in RFC3339 text format.
description Changes to this property will trigger replacement. str
An optional description of this resource.
disk_size_gb int
Size of the snapshot, specified in GB.
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.
label_fingerprint str
The fingerprint used for optimistic locking of this resource. Used internally during updates.
labels Mapping[str, str]
Labels to apply to this Snapshot. 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.
licenses Sequence[str]
A list of public visible licenses that apply to this snapshot. This can be because the original image had licenses attached (such as a Windows image). snapshotEncryptionKey nested object Encrypts the snapshot using a customer-supplied encryption key.
name Changes to this property will trigger replacement. str
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.
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.
self_link str
The URI of the created resource.
snapshot_encryption_key Changes to this property will trigger replacement. SnapshotSnapshotEncryptionKeyArgs
Encrypts the snapshot using a customer-supplied encryption key. After you encrypt a snapshot using a customer-supplied key, you must provide the same key if you use the snapshot later. For example, you must provide the encryption key when you create a disk from the encrypted snapshot in a future request. Customer-supplied encryption keys do not protect access to metadata of the snapshot. If you do not provide an encryption key when creating the snapshot, then the snapshot will be encrypted using an automatically generated key and you do not need to provide a key to use the snapshot later. Structure is documented below.
snapshot_id int
The unique identifier for the resource.
source_disk Changes to this property will trigger replacement. str
A reference to the disk used to create this snapshot.


source_disk_encryption_key Changes to this property will trigger replacement. SnapshotSourceDiskEncryptionKeyArgs
The customer-supplied encryption key of the source snapshot. Required if the source snapshot is protected by a customer-supplied encryption key. Structure is documented below.
storage_bytes int
A size of the storage used by the snapshot. As snapshots share storage, this number is expected to change with snapshot creation/deletion.
storage_locations Changes to this property will trigger replacement. Sequence[str]
Cloud Storage bucket storage location of the snapshot (regional or multi-regional).
zone Changes to this property will trigger replacement. str
A reference to the zone where the disk is hosted.
chainName Changes to this property will trigger replacement. String
Creates the new snapshot in the snapshot chain labeled with the specified name. The chain name must be 1-63 characters long and comply with RFC1035. This is an uncommon option only for advanced service owners who needs to create separate snapshot chains, for example, for chargeback tracking. When you describe your snapshot resource, this field is visible only if it has a non-empty value.
creationTimestamp String
Creation timestamp in RFC3339 text format.
description Changes to this property will trigger replacement. String
An optional description of this resource.
diskSizeGb Number
Size of the snapshot, specified in GB.
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.
labelFingerprint String
The fingerprint used for optimistic locking of this resource. Used internally during updates.
labels Map<String>
Labels to apply to this Snapshot. 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.
licenses List<String>
A list of public visible licenses that apply to this snapshot. This can be because the original image had licenses attached (such as a Windows image). snapshotEncryptionKey nested object Encrypts the snapshot using a customer-supplied encryption key.
name Changes to this property will trigger replacement. String
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.
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.
selfLink String
The URI of the created resource.
snapshotEncryptionKey Changes to this property will trigger replacement. Property Map
Encrypts the snapshot using a customer-supplied encryption key. After you encrypt a snapshot using a customer-supplied key, you must provide the same key if you use the snapshot later. For example, you must provide the encryption key when you create a disk from the encrypted snapshot in a future request. Customer-supplied encryption keys do not protect access to metadata of the snapshot. If you do not provide an encryption key when creating the snapshot, then the snapshot will be encrypted using an automatically generated key and you do not need to provide a key to use the snapshot later. Structure is documented below.
snapshotId Number
The unique identifier for the resource.
sourceDisk Changes to this property will trigger replacement. String
A reference to the disk used to create this snapshot.


sourceDiskEncryptionKey Changes to this property will trigger replacement. Property Map
The customer-supplied encryption key of the source snapshot. Required if the source snapshot is protected by a customer-supplied encryption key. Structure is documented below.
storageBytes Number
A size of the storage used by the snapshot. As snapshots share storage, this number is expected to change with snapshot creation/deletion.
storageLocations Changes to this property will trigger replacement. List<String>
Cloud Storage bucket storage location of the snapshot (regional or multi-regional).
zone Changes to this property will trigger replacement. String
A reference to the zone where the disk is hosted.

Supporting Types

SnapshotSnapshotEncryptionKey
, SnapshotSnapshotEncryptionKeyArgs

KmsKeySelfLink Changes to this property will trigger replacement. string
The name of the encryption key that is stored in Google Cloud KMS.
KmsKeyServiceAccount Changes to this property will trigger replacement. string
The service account used for the encryption request for the given KMS key. If absent, the Compute Engine Service Agent service account is used.
RawKey Changes to this property will trigger replacement. string
Specifies a 256-bit customer-supplied encryption key, encoded in RFC 4648 base64 to either encrypt or decrypt this resource. Note: This property is sensitive and will not be displayed in the plan.
Sha256 string
(Output) The RFC 4648 base64 encoded SHA-256 hash of the customer-supplied encryption key that protects this resource.
KmsKeySelfLink Changes to this property will trigger replacement. string
The name of the encryption key that is stored in Google Cloud KMS.
KmsKeyServiceAccount Changes to this property will trigger replacement. string
The service account used for the encryption request for the given KMS key. If absent, the Compute Engine Service Agent service account is used.
RawKey Changes to this property will trigger replacement. string
Specifies a 256-bit customer-supplied encryption key, encoded in RFC 4648 base64 to either encrypt or decrypt this resource. Note: This property is sensitive and will not be displayed in the plan.
Sha256 string
(Output) The RFC 4648 base64 encoded SHA-256 hash of the customer-supplied encryption key that protects this resource.
kmsKeySelfLink Changes to this property will trigger replacement. String
The name of the encryption key that is stored in Google Cloud KMS.
kmsKeyServiceAccount Changes to this property will trigger replacement. String
The service account used for the encryption request for the given KMS key. If absent, the Compute Engine Service Agent service account is used.
rawKey Changes to this property will trigger replacement. String
Specifies a 256-bit customer-supplied encryption key, encoded in RFC 4648 base64 to either encrypt or decrypt this resource. Note: This property is sensitive and will not be displayed in the plan.
sha256 String
(Output) The RFC 4648 base64 encoded SHA-256 hash of the customer-supplied encryption key that protects this resource.
kmsKeySelfLink Changes to this property will trigger replacement. string
The name of the encryption key that is stored in Google Cloud KMS.
kmsKeyServiceAccount Changes to this property will trigger replacement. string
The service account used for the encryption request for the given KMS key. If absent, the Compute Engine Service Agent service account is used.
rawKey Changes to this property will trigger replacement. string
Specifies a 256-bit customer-supplied encryption key, encoded in RFC 4648 base64 to either encrypt or decrypt this resource. Note: This property is sensitive and will not be displayed in the plan.
sha256 string
(Output) The RFC 4648 base64 encoded SHA-256 hash of the customer-supplied encryption key that protects this resource.
kms_key_self_link Changes to this property will trigger replacement. str
The name of the encryption key that is stored in Google Cloud KMS.
kms_key_service_account Changes to this property will trigger replacement. str
The service account used for the encryption request for the given KMS key. If absent, the Compute Engine Service Agent service account is used.
raw_key Changes to this property will trigger replacement. str
Specifies a 256-bit customer-supplied encryption key, encoded in RFC 4648 base64 to either encrypt or decrypt this resource. Note: This property is sensitive and will not be displayed in the plan.
sha256 str
(Output) The RFC 4648 base64 encoded SHA-256 hash of the customer-supplied encryption key that protects this resource.
kmsKeySelfLink Changes to this property will trigger replacement. String
The name of the encryption key that is stored in Google Cloud KMS.
kmsKeyServiceAccount Changes to this property will trigger replacement. String
The service account used for the encryption request for the given KMS key. If absent, the Compute Engine Service Agent service account is used.
rawKey Changes to this property will trigger replacement. String
Specifies a 256-bit customer-supplied encryption key, encoded in RFC 4648 base64 to either encrypt or decrypt this resource. Note: This property is sensitive and will not be displayed in the plan.
sha256 String
(Output) The RFC 4648 base64 encoded SHA-256 hash of the customer-supplied encryption key that protects this resource.

SnapshotSourceDiskEncryptionKey
, SnapshotSourceDiskEncryptionKeyArgs

KmsKeyServiceAccount Changes to this property will trigger replacement. string
The service account used for the encryption request for the given KMS key. If absent, the Compute Engine Service Agent service account is used.
RawKey Changes to this property will trigger replacement. string
Specifies a 256-bit customer-supplied encryption key, encoded in RFC 4648 base64 to either encrypt or decrypt this resource. Note: This property is sensitive and will not be displayed in the plan.
KmsKeyServiceAccount Changes to this property will trigger replacement. string
The service account used for the encryption request for the given KMS key. If absent, the Compute Engine Service Agent service account is used.
RawKey Changes to this property will trigger replacement. string
Specifies a 256-bit customer-supplied encryption key, encoded in RFC 4648 base64 to either encrypt or decrypt this resource. Note: This property is sensitive and will not be displayed in the plan.
kmsKeyServiceAccount Changes to this property will trigger replacement. String
The service account used for the encryption request for the given KMS key. If absent, the Compute Engine Service Agent service account is used.
rawKey Changes to this property will trigger replacement. String
Specifies a 256-bit customer-supplied encryption key, encoded in RFC 4648 base64 to either encrypt or decrypt this resource. Note: This property is sensitive and will not be displayed in the plan.
kmsKeyServiceAccount Changes to this property will trigger replacement. string
The service account used for the encryption request for the given KMS key. If absent, the Compute Engine Service Agent service account is used.
rawKey Changes to this property will trigger replacement. string
Specifies a 256-bit customer-supplied encryption key, encoded in RFC 4648 base64 to either encrypt or decrypt this resource. Note: This property is sensitive and will not be displayed in the plan.
kms_key_service_account Changes to this property will trigger replacement. str
The service account used for the encryption request for the given KMS key. If absent, the Compute Engine Service Agent service account is used.
raw_key Changes to this property will trigger replacement. str
Specifies a 256-bit customer-supplied encryption key, encoded in RFC 4648 base64 to either encrypt or decrypt this resource. Note: This property is sensitive and will not be displayed in the plan.
kmsKeyServiceAccount Changes to this property will trigger replacement. String
The service account used for the encryption request for the given KMS key. If absent, the Compute Engine Service Agent service account is used.
rawKey Changes to this property will trigger replacement. String
Specifies a 256-bit customer-supplied encryption key, encoded in RFC 4648 base64 to either encrypt or decrypt this resource. Note: This property is sensitive and will not be displayed in the plan.

Import

Snapshot can be imported using any of these accepted formats:

  • projects/{{project}}/global/snapshots/{{name}}

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

  • {{name}}

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

$ pulumi import gcp:compute/snapshot:Snapshot default projects/{{project}}/global/snapshots/{{name}}
Copy
$ pulumi import gcp:compute/snapshot:Snapshot default {{project}}/{{name}}
Copy
$ pulumi import gcp:compute/snapshot:Snapshot default {{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.