1. Packages
  2. Hcloud Provider
  3. API Docs
  4. getStorageBox
Hetzner Cloud v1.29.0 published on Saturday, Nov 29, 2025 by Pulumi
hcloud logo
Hetzner Cloud v1.29.0 published on Saturday, Nov 29, 2025 by Pulumi

    Example Usage

    import * as pulumi from "@pulumi/pulumi";
    import * as hcloud from "@pulumi/hcloud";
    
    const byId = hcloud.getStorageBox({
        id: 1333,
    });
    const byName = hcloud.getStorageBox({
        name: "backups",
    });
    const byLabelSelector = hcloud.getStorageBox({
        withSelector: "env=production",
    });
    
    import pulumi
    import pulumi_hcloud as hcloud
    
    by_id = hcloud.get_storage_box(id=1333)
    by_name = hcloud.get_storage_box(name="backups")
    by_label_selector = hcloud.get_storage_box(with_selector="env=production")
    
    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.LookupStorageBox(ctx, &hcloud.LookupStorageBoxArgs{
    			Id: pulumi.IntRef(1333),
    		}, nil)
    		if err != nil {
    			return err
    		}
    		_, err = hcloud.LookupStorageBox(ctx, &hcloud.LookupStorageBoxArgs{
    			Name: pulumi.StringRef("backups"),
    		}, nil)
    		if err != nil {
    			return err
    		}
    		_, err = hcloud.LookupStorageBox(ctx, &hcloud.LookupStorageBoxArgs{
    			WithSelector: pulumi.StringRef("env=production"),
    		}, 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 byId = HCloud.GetStorageBox.Invoke(new()
        {
            Id = 1333,
        });
    
        var byName = HCloud.GetStorageBox.Invoke(new()
        {
            Name = "backups",
        });
    
        var byLabelSelector = HCloud.GetStorageBox.Invoke(new()
        {
            WithSelector = "env=production",
        });
    
    });
    
    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.GetStorageBoxArgs;
    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 byId = HcloudFunctions.getStorageBox(GetStorageBoxArgs.builder()
                .id(1333)
                .build());
    
            final var byName = HcloudFunctions.getStorageBox(GetStorageBoxArgs.builder()
                .name("backups")
                .build());
    
            final var byLabelSelector = HcloudFunctions.getStorageBox(GetStorageBoxArgs.builder()
                .withSelector("env=production")
                .build());
    
        }
    }
    
    variables:
      byId:
        fn::invoke:
          function: hcloud:getStorageBox
          arguments:
            id: 1333
      byName:
        fn::invoke:
          function: hcloud:getStorageBox
          arguments:
            name: backups
      byLabelSelector:
        fn::invoke:
          function: hcloud:getStorageBox
          arguments:
            withSelector: env=production
    

    Using getStorageBox

    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 getStorageBox(args: GetStorageBoxArgs, opts?: InvokeOptions): Promise<GetStorageBoxResult>
    function getStorageBoxOutput(args: GetStorageBoxOutputArgs, opts?: InvokeOptions): Output<GetStorageBoxResult>
    def get_storage_box(id: Optional[int] = None,
                        name: Optional[str] = None,
                        with_selector: Optional[str] = None,
                        opts: Optional[InvokeOptions] = None) -> GetStorageBoxResult
    def get_storage_box_output(id: Optional[pulumi.Input[int]] = None,
                        name: Optional[pulumi.Input[str]] = None,
                        with_selector: Optional[pulumi.Input[str]] = None,
                        opts: Optional[InvokeOptions] = None) -> Output[GetStorageBoxResult]
    func LookupStorageBox(ctx *Context, args *LookupStorageBoxArgs, opts ...InvokeOption) (*LookupStorageBoxResult, error)
    func LookupStorageBoxOutput(ctx *Context, args *LookupStorageBoxOutputArgs, opts ...InvokeOption) LookupStorageBoxResultOutput

    > Note: This function is named LookupStorageBox in the Go SDK.

    public static class GetStorageBox 
    {
        public static Task<GetStorageBoxResult> InvokeAsync(GetStorageBoxArgs args, InvokeOptions? opts = null)
        public static Output<GetStorageBoxResult> Invoke(GetStorageBoxInvokeArgs args, InvokeOptions? opts = null)
    }
    public static CompletableFuture<GetStorageBoxResult> getStorageBox(GetStorageBoxArgs args, InvokeOptions options)
    public static Output<GetStorageBoxResult> getStorageBox(GetStorageBoxArgs args, InvokeOptions options)
    
    fn::invoke:
      function: hcloud:index/getStorageBox:getStorageBox
      arguments:
        # arguments dictionary

    The following arguments are supported:

    Id int
    ID of the Storage Box.
    Name string
    Name of the Storage Box.
    WithSelector string
    Filter results using a Label Selector.
    Id int
    ID of the Storage Box.
    Name string
    Name of the Storage Box.
    WithSelector string
    Filter results using a Label Selector.
    id Integer
    ID of the Storage Box.
    name String
    Name of the Storage Box.
    withSelector String
    Filter results using a Label Selector.
    id number
    ID of the Storage Box.
    name string
    Name of the Storage Box.
    withSelector string
    Filter results using a Label Selector.
    id int
    ID of the Storage Box.
    name str
    Name of the Storage Box.
    with_selector str
    Filter results using a Label Selector.
    id Number
    ID of the Storage Box.
    name String
    Name of the Storage Box.
    withSelector String
    Filter results using a Label Selector.

    getStorageBox Result

    The following output properties are available:

    AccessSettings Pulumi.HCloud.Outputs.GetStorageBoxAccessSettings
    Access settings of the Storage Box.
    DeleteProtection bool
    Whether delete protection is enabled.
    Labels Dictionary<string, string>
    User-defined labels (key-value pairs) for the resource.
    Location string
    Name of the Location.
    Server string
    FQDN of the Storage Box.
    SnapshotPlan Pulumi.HCloud.Outputs.GetStorageBoxSnapshotPlan
    Details of the active snapshot plan.
    StorageBoxType string
    Name of the Storage Box Type.
    System string
    Host system of the Storage Box.
    Username string
    Primary username of the Storage Box.
    Id int
    ID of the Storage Box.
    Name string
    Name of the Storage Box.
    WithSelector string
    Filter results using a Label Selector.
    AccessSettings GetStorageBoxAccessSettings
    Access settings of the Storage Box.
    DeleteProtection bool
    Whether delete protection is enabled.
    Labels map[string]string
    User-defined labels (key-value pairs) for the resource.
    Location string
    Name of the Location.
    Server string
    FQDN of the Storage Box.
    SnapshotPlan GetStorageBoxSnapshotPlan
    Details of the active snapshot plan.
    StorageBoxType string
    Name of the Storage Box Type.
    System string
    Host system of the Storage Box.
    Username string
    Primary username of the Storage Box.
    Id int
    ID of the Storage Box.
    Name string
    Name of the Storage Box.
    WithSelector string
    Filter results using a Label Selector.
    accessSettings GetStorageBoxAccessSettings
    Access settings of the Storage Box.
    deleteProtection Boolean
    Whether delete protection is enabled.
    labels Map<String,String>
    User-defined labels (key-value pairs) for the resource.
    location String
    Name of the Location.
    server String
    FQDN of the Storage Box.
    snapshotPlan GetStorageBoxSnapshotPlan
    Details of the active snapshot plan.
    storageBoxType String
    Name of the Storage Box Type.
    system String
    Host system of the Storage Box.
    username String
    Primary username of the Storage Box.
    id Integer
    ID of the Storage Box.
    name String
    Name of the Storage Box.
    withSelector String
    Filter results using a Label Selector.
    accessSettings GetStorageBoxAccessSettings
    Access settings of the Storage Box.
    deleteProtection boolean
    Whether delete protection is enabled.
    labels {[key: string]: string}
    User-defined labels (key-value pairs) for the resource.
    location string
    Name of the Location.
    server string
    FQDN of the Storage Box.
    snapshotPlan GetStorageBoxSnapshotPlan
    Details of the active snapshot plan.
    storageBoxType string
    Name of the Storage Box Type.
    system string
    Host system of the Storage Box.
    username string
    Primary username of the Storage Box.
    id number
    ID of the Storage Box.
    name string
    Name of the Storage Box.
    withSelector string
    Filter results using a Label Selector.
    access_settings GetStorageBoxAccessSettings
    Access settings of the Storage Box.
    delete_protection bool
    Whether delete protection is enabled.
    labels Mapping[str, str]
    User-defined labels (key-value pairs) for the resource.
    location str
    Name of the Location.
    server str
    FQDN of the Storage Box.
    snapshot_plan GetStorageBoxSnapshotPlan
    Details of the active snapshot plan.
    storage_box_type str
    Name of the Storage Box Type.
    system str
    Host system of the Storage Box.
    username str
    Primary username of the Storage Box.
    id int
    ID of the Storage Box.
    name str
    Name of the Storage Box.
    with_selector str
    Filter results using a Label Selector.
    accessSettings Property Map
    Access settings of the Storage Box.
    deleteProtection Boolean
    Whether delete protection is enabled.
    labels Map<String>
    User-defined labels (key-value pairs) for the resource.
    location String
    Name of the Location.
    server String
    FQDN of the Storage Box.
    snapshotPlan Property Map
    Details of the active snapshot plan.
    storageBoxType String
    Name of the Storage Box Type.
    system String
    Host system of the Storage Box.
    username String
    Primary username of the Storage Box.
    id Number
    ID of the Storage Box.
    name String
    Name of the Storage Box.
    withSelector String
    Filter results using a Label Selector.

    Supporting Types

    GetStorageBoxAccessSettings

    ReachableExternally bool
    Whether access from outside the Hetzner network is allowed.
    SambaEnabled bool
    Whether the Samba subsystem is enabled.
    SshEnabled bool
    Whether the SSH subsystem is enabled.
    WebdavEnabled bool
    Whether the WebDAV subsystem is enabled.
    ZfsEnabled bool
    Whether the ZFS snapshot folder is visible.
    ReachableExternally bool
    Whether access from outside the Hetzner network is allowed.
    SambaEnabled bool
    Whether the Samba subsystem is enabled.
    SshEnabled bool
    Whether the SSH subsystem is enabled.
    WebdavEnabled bool
    Whether the WebDAV subsystem is enabled.
    ZfsEnabled bool
    Whether the ZFS snapshot folder is visible.
    reachableExternally Boolean
    Whether access from outside the Hetzner network is allowed.
    sambaEnabled Boolean
    Whether the Samba subsystem is enabled.
    sshEnabled Boolean
    Whether the SSH subsystem is enabled.
    webdavEnabled Boolean
    Whether the WebDAV subsystem is enabled.
    zfsEnabled Boolean
    Whether the ZFS snapshot folder is visible.
    reachableExternally boolean
    Whether access from outside the Hetzner network is allowed.
    sambaEnabled boolean
    Whether the Samba subsystem is enabled.
    sshEnabled boolean
    Whether the SSH subsystem is enabled.
    webdavEnabled boolean
    Whether the WebDAV subsystem is enabled.
    zfsEnabled boolean
    Whether the ZFS snapshot folder is visible.
    reachable_externally bool
    Whether access from outside the Hetzner network is allowed.
    samba_enabled bool
    Whether the Samba subsystem is enabled.
    ssh_enabled bool
    Whether the SSH subsystem is enabled.
    webdav_enabled bool
    Whether the WebDAV subsystem is enabled.
    zfs_enabled bool
    Whether the ZFS snapshot folder is visible.
    reachableExternally Boolean
    Whether access from outside the Hetzner network is allowed.
    sambaEnabled Boolean
    Whether the Samba subsystem is enabled.
    sshEnabled Boolean
    Whether the SSH subsystem is enabled.
    webdavEnabled Boolean
    Whether the WebDAV subsystem is enabled.
    zfsEnabled Boolean
    Whether the ZFS snapshot folder is visible.

    GetStorageBoxSnapshotPlan

    DayOfMonth int
    Day of the month when the Snapshot Plan is executed. Null means every day.
    DayOfWeek int
    Day of the week when the Snapshot Plan is executed. Starts at 0 for Sunday til 6 for Saturday. Note that this differs from the API, which uses 1 (Monday) through 7 (Sunday). Null means every day.
    Hour int
    Hour when the Snapshot Plan is executed (UTC).
    MaxSnapshots int
    Maximum amount of Snapshots that will be created by this Snapshot Plan. Older Snapshots will be deleted.
    Minute int
    Minute when the Snapshot Plan is executed (UTC).
    DayOfMonth int
    Day of the month when the Snapshot Plan is executed. Null means every day.
    DayOfWeek int
    Day of the week when the Snapshot Plan is executed. Starts at 0 for Sunday til 6 for Saturday. Note that this differs from the API, which uses 1 (Monday) through 7 (Sunday). Null means every day.
    Hour int
    Hour when the Snapshot Plan is executed (UTC).
    MaxSnapshots int
    Maximum amount of Snapshots that will be created by this Snapshot Plan. Older Snapshots will be deleted.
    Minute int
    Minute when the Snapshot Plan is executed (UTC).
    dayOfMonth Integer
    Day of the month when the Snapshot Plan is executed. Null means every day.
    dayOfWeek Integer
    Day of the week when the Snapshot Plan is executed. Starts at 0 for Sunday til 6 for Saturday. Note that this differs from the API, which uses 1 (Monday) through 7 (Sunday). Null means every day.
    hour Integer
    Hour when the Snapshot Plan is executed (UTC).
    maxSnapshots Integer
    Maximum amount of Snapshots that will be created by this Snapshot Plan. Older Snapshots will be deleted.
    minute Integer
    Minute when the Snapshot Plan is executed (UTC).
    dayOfMonth number
    Day of the month when the Snapshot Plan is executed. Null means every day.
    dayOfWeek number
    Day of the week when the Snapshot Plan is executed. Starts at 0 for Sunday til 6 for Saturday. Note that this differs from the API, which uses 1 (Monday) through 7 (Sunday). Null means every day.
    hour number
    Hour when the Snapshot Plan is executed (UTC).
    maxSnapshots number
    Maximum amount of Snapshots that will be created by this Snapshot Plan. Older Snapshots will be deleted.
    minute number
    Minute when the Snapshot Plan is executed (UTC).
    day_of_month int
    Day of the month when the Snapshot Plan is executed. Null means every day.
    day_of_week int
    Day of the week when the Snapshot Plan is executed. Starts at 0 for Sunday til 6 for Saturday. Note that this differs from the API, which uses 1 (Monday) through 7 (Sunday). Null means every day.
    hour int
    Hour when the Snapshot Plan is executed (UTC).
    max_snapshots int
    Maximum amount of Snapshots that will be created by this Snapshot Plan. Older Snapshots will be deleted.
    minute int
    Minute when the Snapshot Plan is executed (UTC).
    dayOfMonth Number
    Day of the month when the Snapshot Plan is executed. Null means every day.
    dayOfWeek Number
    Day of the week when the Snapshot Plan is executed. Starts at 0 for Sunday til 6 for Saturday. Note that this differs from the API, which uses 1 (Monday) through 7 (Sunday). Null means every day.
    hour Number
    Hour when the Snapshot Plan is executed (UTC).
    maxSnapshots Number
    Maximum amount of Snapshots that will be created by this Snapshot Plan. Older Snapshots will be deleted.
    minute Number
    Minute when the Snapshot Plan is executed (UTC).

    Package Details

    Repository
    Hetzner Cloud pulumi/pulumi-hcloud
    License
    Apache-2.0
    Notes
    This Pulumi package is based on the hcloud Terraform Provider.
    hcloud logo
    Hetzner Cloud v1.29.0 published on Saturday, Nov 29, 2025 by Pulumi
      Meet Neo: Your AI Platform Teammate