getSnapshot

To get more information about Snapshot, see:

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

argument

A collection of arguments for invoking getSnapshot.


suspend fun getSnapshot(filter: String? = null, mostRecent: Boolean? = null, name: String? = null, project: String? = null): GetSnapshotResult

Return

A collection of values returned by getSnapshot.

Parameters

filter

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.

mostRecent

If filter is provided, ensures the most recent snapshot is returned when multiple compute snapshot match.

name

The name of the compute snapshot. One of name or filter must be provided.

project

The ID of the project in which the resource belongs. If it is not provided, the provider project is used.

See also


suspend fun getSnapshot(argument: suspend GetSnapshotPlainArgsBuilder.() -> Unit): GetSnapshotResult

Return

A collection of values returned by getSnapshot.

Parameters

argument

Builder for com.pulumi.gcp.compute.kotlin.inputs.GetSnapshotPlainArgs.

See also