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/v7/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/v7/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=gcp.compute.SnapshotSnapshotEncryptionKeyArgs(
kms_key_self_link="string",
kms_key_service_account="string",
raw_key="string",
sha256="string",
),
source_disk_encryption_key=gcp.compute.SnapshotSourceDiskEncryptionKeyArgs(
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
The Snapshot resource accepts the following input properties:
- Source
Disk string - A reference to the disk used to create this snapshot.
- Chain
Name 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_labels
for 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.
- Snapshot
Encryption 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.
- Source
Disk 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.
- Storage
Locations 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.
- Source
Disk string - A reference to the disk used to create this snapshot.
- Chain
Name 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_labels
for 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.
- 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 []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 String - A reference to the disk used to create this snapshot.
- chain
Name 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_labels
for 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.
- snapshot
Encryption 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.
- source
Disk 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.
- storage
Locations 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.
- source
Disk string - A reference to the disk used to create this snapshot.
- chain
Name 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_labels
for 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.
- snapshot
Encryption 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.
- source
Disk 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.
- storage
Locations 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_labels
for 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.
- source
Disk String - A reference to the disk used to create this snapshot.
- chain
Name 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_labels
for 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.
- snapshot
Encryption 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.
- source
Disk 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.
- storage
Locations 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:
- Creation
Timestamp string - Creation timestamp in RFC3339 text format.
- Disk
Size intGb - Size of the snapshot, specified in GB.
- Effective
Labels 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.
- Label
Fingerprint 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.
- Pulumi
Labels Dictionary<string, string> - The combination of labels configured directly on the resource and default labels configured on the provider.
- Self
Link string - 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.
- Creation
Timestamp string - Creation timestamp in RFC3339 text format.
- Disk
Size intGb - Size of the snapshot, specified in GB.
- Effective
Labels 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.
- Label
Fingerprint 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.
- Pulumi
Labels map[string]string - The combination of labels configured directly on the resource and default labels configured on the provider.
- Self
Link string - 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.
- creation
Timestamp String - Creation timestamp in RFC3339 text format.
- disk
Size IntegerGb - Size of the snapshot, specified in GB.
- effective
Labels 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.
- label
Fingerprint 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.
- pulumi
Labels Map<String,String> - The combination of labels configured directly on the resource and default labels configured on the provider.
- self
Link String - The URI of the created resource.
- snapshot
Id Integer - The unique identifier for the resource.
- storage
Bytes Integer - 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 string - Creation timestamp in RFC3339 text format.
- disk
Size numberGb - Size of the snapshot, specified in GB.
- effective
Labels {[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.
- label
Fingerprint 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.
- pulumi
Labels {[key: string]: string} - The combination of labels configured directly on the resource and default labels configured on the provider.
- self
Link string - The URI of the created resource.
- snapshot
Id number - The unique identifier for the resource.
- storage
Bytes 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.
- creation
Timestamp String - Creation timestamp in RFC3339 text format.
- disk
Size NumberGb - Size of the snapshot, specified in GB.
- effective
Labels 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.
- label
Fingerprint 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.
- pulumi
Labels Map<String> - The combination of labels configured directly on the resource and default labels configured on the provider.
- self
Link String - The URI of the created resource.
- snapshot
Id Number - The unique identifier for the resource.
- storage
Bytes 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
- 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.
- Chain
Name 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.
- Creation
Timestamp string - Creation timestamp in RFC3339 text format.
- Description string
- An optional description of this resource.
- Disk
Size intGb - Size of the snapshot, specified in GB.
- Effective
Labels 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.
- Label
Fingerprint 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 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.
- Pulumi
Labels Dictionary<string, string> - The combination of labels configured directly on the resource and default labels configured on the provider.
- Self
Link string - The URI of the created resource.
- Snapshot
Encryption 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.
- Snapshot
Id int - The unique identifier for the resource.
- Source
Disk string - A reference to the disk used to create this snapshot.
- Source
Disk 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.
- 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 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.
- Chain
Name 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.
- Creation
Timestamp string - Creation timestamp in RFC3339 text format.
- Description string
- An optional description of this resource.
- Disk
Size intGb - Size of the snapshot, specified in GB.
- Effective
Labels 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.
- Label
Fingerprint 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 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.
- Pulumi
Labels map[string]string - The combination of labels configured directly on the resource and default labels configured on the provider.
- Self
Link string - 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 string - 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 []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 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.
- creation
Timestamp String - Creation timestamp in RFC3339 text format.
- description String
- An optional description of this resource.
- disk
Size IntegerGb - Size of the snapshot, specified in GB.
- effective
Labels 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.
- label
Fingerprint 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 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.
- pulumi
Labels Map<String,String> - The combination of labels configured directly on the resource and default labels configured on the provider.
- self
Link String - The URI of the created resource.
- snapshot
Encryption 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.
- snapshot
Id Integer - The unique identifier for the resource.
- source
Disk String - A reference to the disk used to create this snapshot.
- source
Disk 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.
- storage
Bytes Integer - 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 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.
- chain
Name 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.
- creation
Timestamp string - Creation timestamp in RFC3339 text format.
- description string
- An optional description of this resource.
- disk
Size numberGb - Size of the snapshot, specified in GB.
- effective
Labels {[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.
- label
Fingerprint 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 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.
- pulumi
Labels {[key: string]: string} - The combination of labels configured directly on the resource and default labels configured on the provider.
- self
Link string - The URI of the created resource.
- snapshot
Encryption 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.
- snapshot
Id number - The unique identifier for the resource.
- source
Disk string - A reference to the disk used to create this snapshot.
- source
Disk 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.
- storage
Bytes number - 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 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_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 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.
- chain
Name 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.
- creation
Timestamp String - Creation timestamp in RFC3339 text format.
- description String
- An optional description of this resource.
- disk
Size NumberGb - Size of the snapshot, specified in GB.
- effective
Labels Map<String> - All of labels (key/value pairs) present on the resource in GCP, including the labels configured through Pulumi, other clients and services.
- label
Fingerprint 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 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.
- pulumi
Labels Map<String> - The combination of labels configured directly on the resource and default labels configured on the provider.
- self
Link String - The URI of the created resource.
- snapshot
Encryption 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.
- snapshot
Id Number - The unique identifier for the resource.
- source
Disk String - A reference to the disk used to create this snapshot.
- source
Disk 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.
- storage
Bytes Number - 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 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
- Kms
Key stringSelf Link - The name of the encryption key that is stored in Google Cloud KMS.
- Kms
Key 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.
- Raw
Key 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 stringSelf Link - The name of the encryption key that is stored in Google Cloud KMS.
- Kms
Key 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.
- Raw
Key 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 StringSelf Link - The name of the encryption key that is stored in Google Cloud KMS.
- kms
Key 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.
- raw
Key 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 stringSelf Link - The name of the encryption key that is stored in Google Cloud KMS.
- kms
Key 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.
- raw
Key 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.
- kms
Key StringSelf Link - The name of the encryption key that is stored in Google Cloud KMS.
- kms
Key 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.
- raw
Key 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
- Kms
Key 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.
- Raw
Key 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 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.
- Raw
Key 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 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.
- raw
Key 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 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.
- raw
Key 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.
- kms
Key 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.
- raw
Key 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-beta
Terraform Provider.