subcategory | page_title | description |
---|---|---|
Compute Engine |
Google: google_compute_snapshot |
Get information about a Google Compute Snapshot. |
To get more information about Snapshot, see:
- API documentation
- How-to Guides
#by name
data "google_compute_snapshot" "snapshot" {
name = "my-snapshot"
}
# using a filter
data "google_compute_snapshot" "latest-snapshot" {
filter = "name != my-snapshot"
most_recent = true
}
The following arguments are supported:
-
name
- (Optional) The name of the compute snapshot. One ofname
orfilter
must be provided. -
filter
- (Optional) A filter to retrieve the compute snapshot. See gcloud topic filters for reference. If multiple compute snapshot match, either adjust the filter or specifymost_recent
. One ofname
orfilter
must be provided. -
most_recent
- (Optional) Iffilter
is provided, ensures the most recent snapshot is returned when multiple compute snapshot match.
project
- (Optional) The ID of the project in which the resource belongs. If it is not provided, the provider project is used.
See google_compute_snapshot resource for details of the available attributes.