civo 1.1.7 published on Sunday, Sep 14, 2025 by civo
civo.getVolume
Explore with Pulumi AI
Get information on a volume for use in other resources. This data source provides all of the volumes properties as configured on your Civo account.
An error will be raised if the provided volume name does not exist in your Civo account.
Example Usage
import * as pulumi from "@pulumi/pulumi";
import * as civo from "@pulumi/civo";
const myvolume = civo.getVolume({
name: "test-volume-name",
});
export const volumeOutput = myvolume;
import pulumi
import pulumi_civo as civo
myvolume = civo.get_volume(name="test-volume-name")
pulumi.export("volumeOutput", myvolume)
package main
import (
"github.com/pulumi/pulumi-terraform-provider/sdks/go/civo/civo"
"github.com/pulumi/pulumi/sdk/v3/go/pulumi"
)
func main() {
pulumi.Run(func(ctx *pulumi.Context) error {
myvolume, err := civo.LookupVolume(ctx, &civo.LookupVolumeArgs{
Name: pulumi.StringRef("test-volume-name"),
}, nil)
if err != nil {
return err
}
ctx.Export("volumeOutput", myvolume)
return nil
})
}
using System.Collections.Generic;
using System.Linq;
using Pulumi;
using Civo = Pulumi.Civo;
return await Deployment.RunAsync(() =>
{
var myvolume = Civo.GetVolume.Invoke(new()
{
Name = "test-volume-name",
});
return new Dictionary<string, object?>
{
["volumeOutput"] = myvolume,
};
});
package generated_program;
import com.pulumi.Context;
import com.pulumi.Pulumi;
import com.pulumi.core.Output;
import com.pulumi.civo.CivoFunctions;
import com.pulumi.civo.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 myvolume = CivoFunctions.getVolume(GetVolumeArgs.builder()
.name("test-volume-name")
.build());
ctx.export("volumeOutput", myvolume.applyValue(getVolumeResult -> getVolumeResult));
}
}
variables:
myvolume:
fn::invoke:
function: civo:getVolume
arguments:
name: test-volume-name
outputs:
volumeOutput: ${myvolume}
Using getVolume
Two invocation forms are available. The direct form accepts plain arguments and either blocks until the result value is available, or returns a Promise-wrapped result. The output form accepts Input-wrapped arguments and returns an Output-wrapped result.
function getVolume(args: GetVolumeArgs, opts?: InvokeOptions): Promise<GetVolumeResult>
function getVolumeOutput(args: GetVolumeOutputArgs, opts?: InvokeOptions): Output<GetVolumeResult>
def get_volume(id: Optional[str] = None,
name: Optional[str] = None,
region: Optional[str] = None,
opts: Optional[InvokeOptions] = None) -> GetVolumeResult
def get_volume_output(id: Optional[pulumi.Input[str]] = None,
name: Optional[pulumi.Input[str]] = None,
region: Optional[pulumi.Input[str]] = None,
opts: Optional[InvokeOptions] = None) -> Output[GetVolumeResult]
func LookupVolume(ctx *Context, args *LookupVolumeArgs, opts ...InvokeOption) (*LookupVolumeResult, error)
func LookupVolumeOutput(ctx *Context, args *LookupVolumeOutputArgs, opts ...InvokeOption) LookupVolumeResultOutput
> Note: This function is named LookupVolume
in the Go SDK.
public static class GetVolume
{
public static Task<GetVolumeResult> InvokeAsync(GetVolumeArgs args, InvokeOptions? opts = null)
public static Output<GetVolumeResult> Invoke(GetVolumeInvokeArgs args, InvokeOptions? opts = null)
}
public static CompletableFuture<GetVolumeResult> getVolume(GetVolumeArgs args, InvokeOptions options)
public static Output<GetVolumeResult> getVolume(GetVolumeArgs args, InvokeOptions options)
fn::invoke:
function: civo:index/getVolume:getVolume
arguments:
# arguments dictionary
The following arguments are supported:
getVolume Result
The following output properties are available:
- Created
At string - The date of the creation of the volume
- Mount
Point string - The mount point of the volume
- Size
Gb double - The size of the volume (in GB)
- Volume
Type string - Id string
- The ID of this resource.
- Name string
- The name of the volume
- Region string
- The region where volume is running
- Created
At string - The date of the creation of the volume
- Mount
Point string - The mount point of the volume
- Size
Gb float64 - The size of the volume (in GB)
- Volume
Type string - Id string
- The ID of this resource.
- Name string
- The name of the volume
- Region string
- The region where volume is running
- created
At String - The date of the creation of the volume
- mount
Point String - The mount point of the volume
- size
Gb Double - The size of the volume (in GB)
- volume
Type String - id String
- The ID of this resource.
- name String
- The name of the volume
- region String
- The region where volume is running
- created
At string - The date of the creation of the volume
- mount
Point string - The mount point of the volume
- size
Gb number - The size of the volume (in GB)
- volume
Type string - id string
- The ID of this resource.
- name string
- The name of the volume
- region string
- The region where volume is running
- created_
at str - The date of the creation of the volume
- mount_
point str - The mount point of the volume
- size_
gb float - The size of the volume (in GB)
- volume_
type str - id str
- The ID of this resource.
- name str
- The name of the volume
- region str
- The region where volume is running
- created
At String - The date of the creation of the volume
- mount
Point String - The mount point of the volume
- size
Gb Number - The size of the volume (in GB)
- volume
Type String - id String
- The ID of this resource.
- name String
- The name of the volume
- region String
- The region where volume is running
Package Details
- Repository
- Civo civo/terraform-provider-civo
- License
- Notes
- This Pulumi package is based on the
civo
Terraform Provider.