Snapshot

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:

Warning: All arguments including snapshot_encryption_key.raw_key and source_disk_encryption_key.raw_key will be stored in the raw state as plain-text. Read more about secrets in state.

Create a Snapshot Resource

def Snapshot(resource_name, opts=None, description=None, labels=None, name=None, project=None, snapshot_encryption_key=None, source_disk=None, source_disk_encryption_key=None, zone=None, __props__=None);
func NewSnapshot(ctx *Context, name string, args SnapshotArgs, opts ...ResourceOption) (*Snapshot, error)
public Snapshot(string name, SnapshotArgs args, CustomResourceOptions? opts = null)
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.
opts ResourceOptions
A bag of options that control this 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.

Snapshot Resource Properties

To learn more about resource properties and how to use them, see Inputs and Outputs in the Programming Model docs.

Inputs

The Snapshot resource accepts the following input properties:

SourceDisk string

A reference to the disk used to create this snapshot.

Description string

An optional description of this resource.

Labels Dictionary<string, string>

Labels to apply to this Snapshot.

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.

SnapshotEncryptionKey SnapshotSnapshotEncryptionKeyArgs

The customer-supplied encryption key of the snapshot. Required if the source snapshot is protected by a customer-supplied encryption key. Structure is documented below.

SourceDiskEncryptionKey SnapshotSourceDiskEncryptionKeyArgs

The customer-supplied encryption key of the source snapshot. Required if the source snapshot is protected by a customer-supplied encryption key. Structure is documented below.

Zone string

A reference to the zone where the disk is hosted.

SourceDisk string

A reference to the disk used to create this snapshot.

Description string

An optional description of this resource.

Labels map[string]string

Labels to apply to this Snapshot.

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.

SnapshotEncryptionKey SnapshotSnapshotEncryptionKey

The customer-supplied encryption key of the snapshot. Required if the source snapshot is protected by a customer-supplied encryption key. Structure is documented below.

SourceDiskEncryptionKey SnapshotSourceDiskEncryptionKey

The customer-supplied encryption key of the source snapshot. Required if the source snapshot is protected by a customer-supplied encryption key. Structure is documented below.

Zone string

A reference to the zone where the disk is hosted.

sourceDisk string

A reference to the disk used to create this snapshot.

description string

An optional description of this resource.

labels {[key: string]: string}

Labels to apply to this Snapshot.

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.

snapshotEncryptionKey SnapshotSnapshotEncryptionKey

The customer-supplied encryption key of the snapshot. Required if the source snapshot is protected by a customer-supplied encryption key. Structure is documented below.

sourceDiskEncryptionKey SnapshotSourceDiskEncryptionKey

The customer-supplied encryption key of the source snapshot. Required if the source snapshot is protected by a customer-supplied encryption key. Structure is documented below.

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.

description str

An optional description of this resource.

labels Dict[str, str]

Labels to apply to this Snapshot.

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_key Dict[SnapshotSnapshotEncryptionKey]

The customer-supplied encryption key of the snapshot. Required if the source snapshot is protected by a customer-supplied encryption key. Structure is documented below.

source_disk_encryption_key Dict[SnapshotSourceDiskEncryptionKey]

The customer-supplied encryption key of the source snapshot. Required if the source snapshot is protected by a customer-supplied encryption key. Structure is documented below.

zone str

A reference to the zone where the disk is hosted.

Outputs

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

CreationTimestamp string

Creation timestamp in RFC3339 text format.

DiskSizeGb int

Size of the snapshot, specified in GB.

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.

SelfLink string

The URI of the created resource.

SnapshotId int

The unique identifier for the resource.

SourceDiskLink string
StorageBytes int

A size of the storage used by the snapshot. As snapshots share storage, this number is expected to change with snapshot creation/deletion.

CreationTimestamp string

Creation timestamp in RFC3339 text format.

DiskSizeGb int

Size of the snapshot, specified in GB.

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.

SelfLink string

The URI of the created resource.

SnapshotId int

The unique identifier for the resource.

SourceDiskLink string
StorageBytes int

A size of the storage used by the snapshot. As snapshots share storage, this number is expected to change with snapshot creation/deletion.

creationTimestamp string

Creation timestamp in RFC3339 text format.

diskSizeGb number

Size of the snapshot, specified in GB.

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.

selfLink string

The URI of the created resource.

snapshotId number

The unique identifier for the resource.

sourceDiskLink string
storageBytes number

A size of the storage used by the snapshot. As snapshots share storage, this number is expected to change with snapshot creation/deletion.

creation_timestamp str

Creation timestamp in RFC3339 text format.

disk_size_gb float

Size of the snapshot, specified in GB.

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 List[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.

self_link str

The URI of the created resource.

snapshot_id float

The unique identifier for the resource.

source_disk_link str
storage_bytes float

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 an 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
static get(resource_name, id, opts=None, creation_timestamp=None, description=None, disk_size_gb=None, label_fingerprint=None, labels=None, licenses=None, name=None, project=None, self_link=None, snapshot_encryption_key=None, snapshot_id=None, source_disk=None, source_disk_encryption_key=None, source_disk_link=None, storage_bytes=None, zone=None, __props__=None);
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)
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.

The following state arguments are supported:

CreationTimestamp string

Creation timestamp in RFC3339 text format.

Description string

An optional description of this resource.

DiskSizeGb int

Size of the snapshot, specified in GB.

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.

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.

SelfLink string

The URI of the created resource.

SnapshotEncryptionKey SnapshotSnapshotEncryptionKeyArgs

The customer-supplied encryption key of the snapshot. Required if the source snapshot is protected by a customer-supplied encryption key. Structure is documented below.

SnapshotId int

The unique identifier for the resource.

SourceDisk string

A reference to the disk used to create this snapshot.

SourceDiskEncryptionKey SnapshotSourceDiskEncryptionKeyArgs

The customer-supplied encryption key of the source snapshot. Required if the source snapshot is protected by a customer-supplied encryption key. Structure is documented below.

SourceDiskLink string
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.

Zone string

A reference to the zone where the disk is hosted.

CreationTimestamp string

Creation timestamp in RFC3339 text format.

Description string

An optional description of this resource.

DiskSizeGb int

Size of the snapshot, specified in GB.

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.

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.

SelfLink string

The URI of the created resource.

SnapshotEncryptionKey SnapshotSnapshotEncryptionKey

The customer-supplied encryption key of the snapshot. Required if the source snapshot is protected by a customer-supplied encryption key. Structure is documented below.

SnapshotId int

The unique identifier for the resource.

SourceDisk string

A reference to the disk used to create this snapshot.

SourceDiskEncryptionKey SnapshotSourceDiskEncryptionKey

The customer-supplied encryption key of the source snapshot. Required if the source snapshot is protected by a customer-supplied encryption key. Structure is documented below.

SourceDiskLink string
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.

Zone string

A reference to the zone where the disk is hosted.

creationTimestamp string

Creation timestamp in RFC3339 text format.

description string

An optional description of this resource.

diskSizeGb number

Size of the snapshot, specified in GB.

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.

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.

selfLink string

The URI of the created resource.

snapshotEncryptionKey SnapshotSnapshotEncryptionKey

The customer-supplied encryption key of the snapshot. Required if the source snapshot is protected by a customer-supplied encryption key. Structure is documented below.

snapshotId number

The unique identifier for the resource.

sourceDisk string

A reference to the disk used to create this snapshot.

sourceDiskEncryptionKey SnapshotSourceDiskEncryptionKey

The customer-supplied encryption key of the source snapshot. Required if the source snapshot is protected by a customer-supplied encryption key. Structure is documented below.

sourceDiskLink string
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.

zone string

A reference to the zone where the disk is hosted.

creation_timestamp str

Creation timestamp in RFC3339 text format.

description str

An optional description of this resource.

disk_size_gb float

Size of the snapshot, specified in GB.

label_fingerprint str

The fingerprint used for optimistic locking of this resource. Used internally during updates.

labels Dict[str, str]

Labels to apply to this Snapshot.

licenses List[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.

self_link str

The URI of the created resource.

snapshot_encryption_key Dict[SnapshotSnapshotEncryptionKey]

The customer-supplied encryption key of the snapshot. Required if the source snapshot is protected by a customer-supplied encryption key. Structure is documented below.

snapshot_id float

The unique identifier for the resource.

source_disk str

A reference to the disk used to create this snapshot.

source_disk_encryption_key Dict[SnapshotSourceDiskEncryptionKey]

The customer-supplied encryption key of the source snapshot. Required if the source snapshot is protected by a customer-supplied encryption key. Structure is documented below.

source_disk_link str
storage_bytes float

A size of the storage used by the snapshot. As snapshots share storage, this number is expected to change with snapshot creation/deletion.

zone str

A reference to the zone where the disk is hosted.

Supporting Types

SnapshotSnapshotEncryptionKey

See the input and output API doc for this type.

See the input and output API doc for this type.

See the input and output API doc for this type.

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

- The RFC 4648 base64 encoded SHA-256 hash of the customer-supplied encryption key that protects this resource.

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

- The RFC 4648 base64 encoded SHA-256 hash of the customer-supplied encryption key that protects this resource.

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

- The RFC 4648 base64 encoded SHA-256 hash of the customer-supplied encryption key that protects this resource.

rawKey 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

- The RFC 4648 base64 encoded SHA-256 hash of the customer-supplied encryption key that protects this resource.

SnapshotSourceDiskEncryptionKey

See the input and output API doc for this type.

See the input and output API doc for this type.

See the input and output API doc for this type.

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.

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.

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.

rawKey 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.

Package Details

Repository
https://github.com/pulumi/pulumi-gcp
License
Apache-2.0
Notes
This Pulumi package is based on the google-beta Terraform Provider.