Civo v2.4.6 published on Wednesday, Nov 6, 2024 by Pulumi
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-civo/sdk/v2/go/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)
// Output-based functions aren't available in Java yet
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 str - The date of the creation of the volume
- mount_
point str - The mount point of the volume
- size_
gb int - The size of the volume (in GB)
- id str
- The ID of this resource.
- name str
- The name of the volume
- region str
- The region where volume is running
Package Details
- Repository
- Civo pulumi/pulumi-civo
- License
- Apache-2.0
- Notes
- This Pulumi package is based on the
civo
Terraform Provider.