getVolume

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.

Schema

Optional

  • id (String) The ID of this resource.
  • name (String) The name of the volume
  • region (String) The region where volume is running

Read-Only

  • 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)

Example Usage

using Pulumi;
using Civo = Pulumi.Civo;

class MyStack : Stack
{
    public MyStack()
    {
        var mysql = Output.Create(Civo.GetVolume.InvokeAsync(new Civo.GetVolumeArgs
        {
            Name = "database-mysql",
        }));
    }

}
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 {
		opt0 := "database-mysql"
		_, err := civo.LookupVolume(ctx, &civo.LookupVolumeArgs{
			Name: &opt0,
		}, nil)
		if err != nil {
			return err
		}
		return nil
	})
}
import pulumi
import pulumi_civo as civo

mysql = civo.get_volume(name="database-mysql")
import * as pulumi from "@pulumi/pulumi";
import * as civo from "@pulumi/civo";

const mysql = pulumi.output(civo.getVolume({
    name: "database-mysql",
}, { async: true }));

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)
}

The following arguments are supported:

Id string
Name string
Region string
Id string
Name string
Region string
id string
name string
region string
id str
name str
region str

getVolume Result

The following output properties are available:

CreatedAt string
MountPoint string
SizeGb int
Id string
Name string
Region string
CreatedAt string
MountPoint string
SizeGb int
Id string
Name string
Region string
createdAt string
mountPoint string
sizeGb number
id string
name string
region string

Package Details

Repository
https://github.com/pulumi/pulumi-civo
License
Apache-2.0
Notes
This Pulumi package is based on the civo Terraform Provider.