getVolume

Provides an Equinix Metal Block Storage Volume datasource to allow you to read existing volumes.

Example Usage

using Pulumi;
using EquinixMetal = Pulumi.EquinixMetal;

class MyStack : Stack
{
    public MyStack()
    {
        var volume1 = Output.Create(EquinixMetal.GetVolume.InvokeAsync(new EquinixMetal.GetVolumeArgs
        {
            Name = "terraform-volume-1",
            ProjectId = local.Project_id,
        }));
        this.VolumeSize = volume1.Apply(volume1 => volume1.Size);
    }

    [Output("volumeSize")]
    public Output<string> VolumeSize { get; set; }
}
package main

import (
	"github.com/pulumi/pulumi-equinix-metal/sdk/v2/go/equinix-metal"
	"github.com/pulumi/pulumi/sdk/v3/go/pulumi"
)

func main() {
	pulumi.Run(func(ctx *pulumi.Context) error {
		opt0 := "terraform-volume-1"
		opt1 := local.Project_id
		volume1, err := equinix - metal.LookupVolume(ctx, &equinix-metal.LookupVolumeArgs{
			Name:      &opt0,
			ProjectId: &opt1,
		}, nil)
		if err != nil {
			return err
		}
		ctx.Export("volumeSize", volume1.Size)
		return nil
	})
}
import pulumi
import pulumi_equinix_metal as equinix_metal

volume1 = equinix_metal.get_volume(name="terraform-volume-1",
    project_id=local["project_id"])
pulumi.export("volumeSize", volume1.size)
import * as pulumi from "@pulumi/pulumi";
import * as equinix_metal from "@pulumi/equinix-metal";

const volume1 = equinix_metal.getVolume({
    name: "terraform-volume-1",
    projectId: local.project_id,
});
export const volumeSize = volume1.then(volume1 => volume1.size);

Using getVolume

function getVolume(args: GetVolumeArgs, opts?: InvokeOptions): Promise<GetVolumeResult>
def get_volume(name: Optional[str] = None,
               project_id: Optional[str] = None,
               volume_id: Optional[str] = None,
               opts: Optional[InvokeOptions] = None) -> GetVolumeResult
func LookupVolume(ctx *Context, args *LookupVolumeArgs, opts ...InvokeOption) (*LookupVolumeResult, error)

Note: This function is named LookupVolume in the Go SDK.

public static class GetVolume {
    public static Task<GetVolumeResult> InvokeAsync(GetVolumeArgs args, InvokeOptions? opts = null)
}

The following arguments are supported:

Name string
Name of volume for lookup
ProjectId string
The ID the parent Equinix Metal project (for lookup by name)
VolumeId string
ID of volume for lookup
Name string
Name of volume for lookup
ProjectId string
The ID the parent Equinix Metal project (for lookup by name)
VolumeId string
ID of volume for lookup
name string
Name of volume for lookup
projectId string
The ID the parent Equinix Metal project (for lookup by name)
volumeId string
ID of volume for lookup
name str
Name of volume for lookup
project_id str
The ID the parent Equinix Metal project (for lookup by name)
volume_id str
ID of volume for lookup

getVolume Result

The following output properties are available:

BillingCycle string
The billing cycle, defaults to hourly
Created string
Description string
DeviceIds List<string>
UUIDs of devices to which this volume is attached
Facility string
The facility slug the volume resides in
Id string
The provider-assigned unique ID for this managed resource.
Locked bool
Whether the volume is locked or not
Name string
The name of the volume
Plan string
Performance plan the volume is on
ProjectId string
The project id the volume is in
Size int
The size in GB of the volume
SnapshotPolicies List<Pulumi.EquinixMetal.Outputs.GetVolumeSnapshotPolicy>
State string
The state of the volume
Updated string
VolumeId string
BillingCycle string
The billing cycle, defaults to hourly
Created string
Description string
DeviceIds []string
UUIDs of devices to which this volume is attached
Facility string
The facility slug the volume resides in
Id string
The provider-assigned unique ID for this managed resource.
Locked bool
Whether the volume is locked or not
Name string
The name of the volume
Plan string
Performance plan the volume is on
ProjectId string
The project id the volume is in
Size int
The size in GB of the volume
SnapshotPolicies []GetVolumeSnapshotPolicy
State string
The state of the volume
Updated string
VolumeId string
billingCycle string
The billing cycle, defaults to hourly
created string
description string
deviceIds string[]
UUIDs of devices to which this volume is attached
facility string
The facility slug the volume resides in
id string
The provider-assigned unique ID for this managed resource.
locked boolean
Whether the volume is locked or not
name string
The name of the volume
plan string
Performance plan the volume is on
projectId string
The project id the volume is in
size number
The size in GB of the volume
snapshotPolicies GetVolumeSnapshotPolicy[]
state string
The state of the volume
updated string
volumeId string
billing_cycle str
The billing cycle, defaults to hourly
created str
description str
device_ids Sequence[str]
UUIDs of devices to which this volume is attached
facility str
The facility slug the volume resides in
id str
The provider-assigned unique ID for this managed resource.
locked bool
Whether the volume is locked or not
name str
The name of the volume
plan str
Performance plan the volume is on
project_id str
The project id the volume is in
size int
The size in GB of the volume
snapshot_policies Sequence[GetVolumeSnapshotPolicy]
state str
The state of the volume
updated str
volume_id str

Supporting Types

GetVolumeSnapshotPolicy

Package Details

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