Expand description
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
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
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
§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}}
Structs§
- Use builder syntax to set the inputs and finish with
build_struct()
.
Functions§
- Registers a new resource with the given unique name and arguments