getVolumeSnapshot

Volume snapshots are saved instances of a block storage volume. Use this data source to retrieve the ID of a DigitalOcean volume snapshot for use in other resources.

Example Usage

Get the volume snapshot:

package generated_program;
import com.pulumi.Context;
import com.pulumi.Pulumi;
import com.pulumi.core.Output;
import com.pulumi.digitalocean.DigitaloceanFunctions;
import com.pulumi.digitalocean.inputs.GetVolumeSnapshotArgs;
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 = DigitaloceanFunctions.getVolumeSnapshot(GetVolumeSnapshotArgs.builder()
.mostRecent(true)
.nameRegex("^web")
.region("nyc3")
.build());
}
}

Return

A collection of values returned by getVolumeSnapshot.

Parameters

argument

A collection of arguments for invoking getVolumeSnapshot.


suspend fun getVolumeSnapshot(mostRecent: Boolean? = null, name: String? = null, nameRegex: String? = null, region: String? = null): GetVolumeSnapshotResult

Return

A collection of values returned by getVolumeSnapshot.

See also

Parameters

mostRecent

If more than one result is returned, use the most recent volume snapshot.

NOTE: If more or less than a single match is returned by the search, the provider will fail. Ensure that your search is specific enough to return a single volume snapshot ID only, or use most_recent to choose the most recent one.

name

The name of the volume snapshot.

nameRegex

A regex string to apply to the volume snapshot list returned by DigitalOcean. This allows more advanced filtering not supported from the DigitalOcean API. This filtering is done locally on what DigitalOcean returns.

region

A "slug" representing a DigitalOcean region (e.g. nyc1). If set, only volume snapshots available in the region will be returned.


Return

A collection of values returned by getVolumeSnapshot.

See also

Parameters

argument

Builder for com.pulumi.digitalocean.kotlin.inputs.GetVolumeSnapshotPlainArgs.