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:
- API documentation
- How-to Guides
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"],
});
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"])
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
	})
}
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",
        },
    });
});
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());
    }
}
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
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"],
});
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"])
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
	})
}
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",
        },
    });
});
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());
    }
}
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
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 string
- The unique name of the resource.
- args SnapshotArgs
- The arguments to resource properties.
- opts CustomResourceOptions
- Bag of options to control resource's behavior.
- resource_name str
- The unique name of the resource.
- args 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 string
- The unique name of the resource.
- args SnapshotArgs
- The arguments to resource properties.
- opts ResourceOption
- Bag of options to control resource's behavior.
- name string
- The unique name of the resource.
- args SnapshotArgs
- The arguments to resource properties.
- opts CustomResourceOptions
- Bag of options to control resource's behavior.
- name String
- The unique name of the resource.
- args 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",
});
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"),
})
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());
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")
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",
});
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
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 string
- A reference to the disk used to create this snapshot.
- ChainName 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 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_labelsfor all of the labels present on the resource.
- Name 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 string
- The ID of the project in which the resource belongs. If it is not provided, the provider project is used.
- SnapshotEncryption SnapshotKey Snapshot Encryption Key 
- 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.
- SourceDisk SnapshotEncryption Key Source Disk Encryption Key 
- 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 List<string>
- Cloud Storage bucket storage location of the snapshot (regional or multi-regional).
- Zone string
- A reference to the zone where the disk is hosted.
- SourceDisk string
- A reference to the disk used to create this snapshot.
- ChainName 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 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_labelsfor all of the labels present on the resource.
- Name 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 string
- The ID of the project in which the resource belongs. If it is not provided, the provider project is used.
- SnapshotEncryption SnapshotKey Snapshot Encryption Key Args 
- 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.
- SourceDisk SnapshotEncryption Key Source Disk Encryption Key Args 
- 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 []string
- Cloud Storage bucket storage location of the snapshot (regional or multi-regional).
- Zone string
- A reference to the zone where the disk is hosted.
- sourceDisk String
- A reference to the disk used to create this snapshot.
- chainName 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 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_labelsfor all of the labels present on the resource.
- name 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 String
- The ID of the project in which the resource belongs. If it is not provided, the provider project is used.
- snapshotEncryption SnapshotKey Snapshot Encryption Key 
- 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.
- sourceDisk SnapshotEncryption Key Source Disk Encryption Key 
- 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 List<String>
- Cloud Storage bucket storage location of the snapshot (regional or multi-regional).
- zone String
- A reference to the zone where the disk is hosted.
- sourceDisk string
- A reference to the disk used to create this snapshot.
- chainName 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 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_labelsfor all of the labels present on the resource.
- name 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 string
- The ID of the project in which the resource belongs. If it is not provided, the provider project is used.
- snapshotEncryption SnapshotKey Snapshot Encryption Key 
- 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.
- sourceDisk SnapshotEncryption Key Source Disk Encryption Key 
- 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 string[]
- Cloud Storage bucket storage location of the snapshot (regional or multi-regional).
- zone string
- A reference to the zone where the disk is hosted.
- source_disk str
- A reference to the disk used to create this snapshot.
- chain_name 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 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_labelsfor all of the labels present on the resource.
- name 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 str
- The ID of the project in which the resource belongs. If it is not provided, the provider project is used.
- snapshot_encryption_ Snapshotkey Snapshot Encryption Key Args 
- 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_ Snapshotencryption_ key Source Disk Encryption Key Args 
- 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 Sequence[str]
- Cloud Storage bucket storage location of the snapshot (regional or multi-regional).
- zone str
- A reference to the zone where the disk is hosted.
- sourceDisk String
- A reference to the disk used to create this snapshot.
- chainName 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 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_labelsfor all of the labels present on the resource.
- name 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 String
- The ID of the project in which the resource belongs. If it is not provided, the provider project is used.
- snapshotEncryption Property MapKey 
- 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.
- sourceDisk Property MapEncryption Key 
- 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 List<String>
- Cloud Storage bucket storage location of the snapshot (regional or multi-regional).
- zone 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.
- DiskSize intGb 
- 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.
- DiskSize intGb 
- 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.
- diskSize IntegerGb 
- 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.
- diskSize numberGb 
- 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_ intgb 
- 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.
- diskSize NumberGb 
- 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) -> Snapshotfunc 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)resources:  _:    type: gcp:compute:Snapshot    get:      id: ${id}- name
- The unique name of the resulting resource.
- id
- 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
- The unique name of the resulting resource.
- id
- The unique provider ID of the resource to lookup.
- name
- The unique name of the resulting resource.
- id
- 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
- The unique name of the resulting resource.
- id
- 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
- The unique name of the resulting resource.
- id
- 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.
- ChainName 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 string
- An optional description of this resource.
- DiskSize intGb 
- 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_labelsfor 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 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 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.
- SnapshotEncryption SnapshotKey Snapshot Encryption Key 
- 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 string
- A reference to the disk used to create this snapshot.
- SourceDisk SnapshotEncryption Key Source Disk Encryption Key 
- 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 List<string>
- Cloud Storage bucket storage location of the snapshot (regional or multi-regional).
- Zone string
- A reference to the zone where the disk is hosted.
- ChainName 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 string
- An optional description of this resource.
- DiskSize intGb 
- 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_labelsfor 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 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 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.
- SnapshotEncryption SnapshotKey Snapshot Encryption Key Args 
- 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 string
- A reference to the disk used to create this snapshot.
- SourceDisk SnapshotEncryption Key Source Disk Encryption Key Args 
- 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 []string
- Cloud Storage bucket storage location of the snapshot (regional or multi-regional).
- Zone string
- A reference to the zone where the disk is hosted.
- chainName 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 String
- An optional description of this resource.
- diskSize IntegerGb 
- 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_labelsfor 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 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 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.
- snapshotEncryption SnapshotKey Snapshot Encryption Key 
- 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 String
- A reference to the disk used to create this snapshot.
- sourceDisk SnapshotEncryption Key Source Disk Encryption Key 
- 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 List<String>
- Cloud Storage bucket storage location of the snapshot (regional or multi-regional).
- zone String
- A reference to the zone where the disk is hosted.
- chainName 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 string
- An optional description of this resource.
- diskSize numberGb 
- 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_labelsfor 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 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 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.
- snapshotEncryption SnapshotKey Snapshot Encryption Key 
- 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 string
- A reference to the disk used to create this snapshot.
- sourceDisk SnapshotEncryption Key Source Disk Encryption Key 
- 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 string[]
- Cloud Storage bucket storage location of the snapshot (regional or multi-regional).
- zone string
- A reference to the zone where the disk is hosted.
- chain_name 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 str
- An optional description of this resource.
- disk_size_ intgb 
- 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_labelsfor 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 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 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_ Snapshotkey Snapshot Encryption Key Args 
- 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 str
- A reference to the disk used to create this snapshot.
- source_disk_ Snapshotencryption_ key Source Disk Encryption Key Args 
- 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 Sequence[str]
- Cloud Storage bucket storage location of the snapshot (regional or multi-regional).
- zone str
- A reference to the zone where the disk is hosted.
- chainName 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 String
- An optional description of this resource.
- diskSize NumberGb 
- 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_labelsfor 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 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 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.
- snapshotEncryption Property MapKey 
- 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 String
- A reference to the disk used to create this snapshot.
- sourceDisk Property MapEncryption Key 
- 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 List<String>
- Cloud Storage bucket storage location of the snapshot (regional or multi-regional).
- zone String
- A reference to the zone where the disk is hosted.
Supporting Types
SnapshotSnapshotEncryptionKey, SnapshotSnapshotEncryptionKeyArgs        
- KmsKey stringSelf Link 
- The name of the encryption key that is stored in Google Cloud KMS.
- KmsKey stringService Account 
- 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 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.
- KmsKey stringSelf Link 
- The name of the encryption key that is stored in Google Cloud KMS.
- KmsKey stringService Account 
- 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 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.
- kmsKey StringSelf Link 
- The name of the encryption key that is stored in Google Cloud KMS.
- kmsKey StringService Account 
- 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 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.
- kmsKey stringSelf Link 
- The name of the encryption key that is stored in Google Cloud KMS.
- kmsKey stringService Account 
- 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 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_ strself_ link 
- The name of the encryption key that is stored in Google Cloud KMS.
- kms_key_ strservice_ account 
- 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 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.
- kmsKey StringSelf Link 
- The name of the encryption key that is stored in Google Cloud KMS.
- kmsKey StringService Account 
- 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 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          
- KmsKey stringService Account 
- 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 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.
- KmsKey stringService Account 
- 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 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.
- kmsKey StringService Account 
- 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 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.
- kmsKey stringService Account 
- 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 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_ strservice_ account 
- 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 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.
- kmsKey StringService Account 
- 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 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}}
$ pulumi import gcp:compute/snapshot:Snapshot default {{project}}/{{name}}
$ pulumi import gcp:compute/snapshot:Snapshot default {{name}}
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-betaTerraform Provider.