Hetzner Cloud v1.25.0 published on Saturday, Sep 27, 2025 by Pulumi
hcloud.getVolumes
Provides details about multiple Hetzner Cloud Volumes.
Example Usage
import * as pulumi from "@pulumi/pulumi";
import * as hcloud from "@pulumi/hcloud";
const volume_ = hcloud.getVolumes({});
const volume3 = hcloud.getVolumes({
    withSelector: "key=value",
});
import pulumi
import pulumi_hcloud as hcloud
volume_ = hcloud.get_volumes()
volume3 = hcloud.get_volumes(with_selector="key=value")
package main
import (
	"github.com/pulumi/pulumi-hcloud/sdk/go/hcloud"
	"github.com/pulumi/pulumi/sdk/v3/go/pulumi"
)
func main() {
	pulumi.Run(func(ctx *pulumi.Context) error {
		_, err := hcloud.GetVolumes(ctx, &hcloud.GetVolumesArgs{}, nil)
		if err != nil {
			return err
		}
		_, err = hcloud.GetVolumes(ctx, &hcloud.GetVolumesArgs{
			WithSelector: pulumi.StringRef("key=value"),
		}, nil)
		if err != nil {
			return err
		}
		return nil
	})
}
using System.Collections.Generic;
using System.Linq;
using Pulumi;
using HCloud = Pulumi.HCloud;
return await Deployment.RunAsync(() => 
{
    var volume_ = HCloud.GetVolumes.Invoke();
    var volume3 = HCloud.GetVolumes.Invoke(new()
    {
        WithSelector = "key=value",
    });
});
package generated_program;
import com.pulumi.Context;
import com.pulumi.Pulumi;
import com.pulumi.core.Output;
import com.pulumi.hcloud.HcloudFunctions;
import com.pulumi.hcloud.inputs.GetVolumesArgs;
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 volume_ = HcloudFunctions.getVolumes(GetVolumesArgs.builder()
            .build());
        final var volume3 = HcloudFunctions.getVolumes(GetVolumesArgs.builder()
            .withSelector("key=value")
            .build());
    }
}
variables:
  volume_:
    fn::invoke:
      function: hcloud:getVolumes
      arguments: {}
  volume3:
    fn::invoke:
      function: hcloud:getVolumes
      arguments:
        withSelector: key=value
Using getVolumes
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 getVolumes(args: GetVolumesArgs, opts?: InvokeOptions): Promise<GetVolumesResult>
function getVolumesOutput(args: GetVolumesOutputArgs, opts?: InvokeOptions): Output<GetVolumesResult>def get_volumes(with_selector: Optional[str] = None,
                with_statuses: Optional[Sequence[str]] = None,
                opts: Optional[InvokeOptions] = None) -> GetVolumesResult
def get_volumes_output(with_selector: Optional[pulumi.Input[str]] = None,
                with_statuses: Optional[pulumi.Input[Sequence[pulumi.Input[str]]]] = None,
                opts: Optional[InvokeOptions] = None) -> Output[GetVolumesResult]func GetVolumes(ctx *Context, args *GetVolumesArgs, opts ...InvokeOption) (*GetVolumesResult, error)
func GetVolumesOutput(ctx *Context, args *GetVolumesOutputArgs, opts ...InvokeOption) GetVolumesResultOutput> Note: This function is named GetVolumes in the Go SDK.
public static class GetVolumes 
{
    public static Task<GetVolumesResult> InvokeAsync(GetVolumesArgs args, InvokeOptions? opts = null)
    public static Output<GetVolumesResult> Invoke(GetVolumesInvokeArgs args, InvokeOptions? opts = null)
}public static CompletableFuture<GetVolumesResult> getVolumes(GetVolumesArgs args, InvokeOptions options)
public static Output<GetVolumesResult> getVolumes(GetVolumesArgs args, InvokeOptions options)
fn::invoke:
  function: hcloud:index/getVolumes:getVolumes
  arguments:
    # arguments dictionaryThe following arguments are supported:
- With
Selector string - Label selector
 - With
Statuses List<string> - List only volumes with the specified status, could contain 
creatingoravailable. 
- With
Selector string - Label selector
 - With
Statuses []string - List only volumes with the specified status, could contain 
creatingoravailable. 
- with
Selector String - Label selector
 - with
Statuses List<String> - List only volumes with the specified status, could contain 
creatingoravailable. 
- with
Selector string - Label selector
 - with
Statuses string[] - List only volumes with the specified status, could contain 
creatingoravailable. 
- with_
selector str - Label selector
 - with_
statuses Sequence[str] - List only volumes with the specified status, could contain 
creatingoravailable. 
- with
Selector String - Label selector
 - with
Statuses List<String> - List only volumes with the specified status, could contain 
creatingoravailable. 
getVolumes Result
The following output properties are available:
- Id string
 - The provider-assigned unique ID for this managed resource.
 - Volumes
List<Pulumi.
HCloud. Outputs. Get Volumes Volume>  - (list) List of all matching volumes. See 
data.hcloud_volumefor schema. - With
Selector string - With
Statuses List<string> 
- Id string
 - The provider-assigned unique ID for this managed resource.
 - Volumes
[]Get
Volumes Volume  - (list) List of all matching volumes. See 
data.hcloud_volumefor schema. - With
Selector string - With
Statuses []string 
- id String
 - The provider-assigned unique ID for this managed resource.
 - volumes
List<Get
Volumes Volume>  - (list) List of all matching volumes. See 
data.hcloud_volumefor schema. - with
Selector String - with
Statuses List<String> 
- id string
 - The provider-assigned unique ID for this managed resource.
 - volumes
Get
Volumes Volume[]  - (list) List of all matching volumes. See 
data.hcloud_volumefor schema. - with
Selector string - with
Statuses string[] 
- id str
 - The provider-assigned unique ID for this managed resource.
 - volumes
Sequence[Get
Volumes Volume]  - (list) List of all matching volumes. See 
data.hcloud_volumefor schema. - with_
selector str - with_
statuses Sequence[str] 
- id String
 - The provider-assigned unique ID for this managed resource.
 - volumes List<Property Map>
 - (list) List of all matching volumes. See 
data.hcloud_volumefor schema. - with
Selector String - with
Statuses List<String> 
Supporting Types
GetVolumesVolume  
- Delete
Protection bool - Id int
 - Labels Dictionary<string, string>
 - Linux
Device string - Name string
 - Size int
 - Location string
 - Server
Id int 
- Delete
Protection bool - Id int
 - Labels map[string]string
 - Linux
Device string - Name string
 - Size int
 - Location string
 - Server
Id int 
- delete
Protection Boolean - id Integer
 - labels Map<String,String>
 - linux
Device String - name String
 - size Integer
 - location String
 - server
Id Integer 
- delete
Protection boolean - id number
 - labels {[key: string]: string}
 - linux
Device string - name string
 - size number
 - location string
 - server
Id number 
- delete_
protection bool - id int
 - labels Mapping[str, str]
 - linux_
device str - name str
 - size int
 - location str
 - server_
id int 
- delete
Protection Boolean - id Number
 - labels Map<String>
 - linux
Device String - name String
 - size Number
 - location String
 - server
Id Number 
Package Details
- Repository
 - Hetzner Cloud pulumi/pulumi-hcloud
 - License
 - Apache-2.0
 - Notes
 - This Pulumi package is based on the 
hcloudTerraform Provider. 
