getVolume

Get information on a volume for use in other resources. This data source provides all of the volumes properties as configured on your DigitalOcean account. This is useful if the volume in question is not managed by the provider or you need to utilize any of the volumes data. An error is triggered if the provided volume name does not exist.

Example Usage

Get the volume:

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.GetVolumeArgs;
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 example = DigitaloceanFunctions.getVolume(GetVolumeArgs.builder()
.name("app-data")
.region("nyc3")
.build());
}
}

Return

A collection of values returned by getVolume.

Parameters

argument

A collection of arguments for invoking getVolume.


suspend fun getVolume(description: String? = null, name: String, region: String? = null): GetVolumeResult

Return

A collection of values returned by getVolume.

See also

Parameters

description

Text describing a block storage volume.

name

The name of block storage volume.

region

The region the block storage volume is provisioned in.


suspend fun getVolume(argument: suspend GetVolumePlainArgsBuilder.() -> Unit): GetVolumeResult

Return

A collection of values returned by getVolume.

See also

Parameters

argument

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