get Snapshot
To get more information about Snapshot, see:
How-to Guides
Example Usage
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.GetSnapshotArgs;
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 snapshot = ComputeFunctions.getSnapshot(GetSnapshotArgs.builder()
.name("my-snapshot")
.build());
final var latest-snapshot = ComputeFunctions.getSnapshot(GetSnapshotArgs.builder()
.filter("name != my-snapshot")
.mostRecent(true)
.build());
}
}
Return
A collection of values returned by getSnapshot.
Parameters
A collection of arguments for invoking getSnapshot.
Return
A collection of values returned by getSnapshot.
Parameters
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.
If filter
is provided, ensures the most recent snapshot is returned when multiple compute snapshot match.
The name of the compute snapshot. One of name
or filter
must be provided.
The ID of the project in which the resource belongs. If it is not provided, the provider project is used.
See also
Return
A collection of values returned by getSnapshot.
Parameters
Builder for com.pulumi.gcp.compute.kotlin.inputs.GetSnapshotPlainArgs.