To get more information about Snapshot, see:
#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 of name
or filter
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 specify most_recent
. One of name
or filter
must be provided.
most_recent
- (Optional) If filter
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.