1. Packages
  2. Hcloud Provider
  3. API Docs
  4. getStorageBoxSubaccounts
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 config = new pulumi.Config();
    const storageBoxId = config.requireObject<any>("storageBoxId");
    const all = hcloud.getStorageBoxSubaccounts({
        storageBoxId: storageBoxId,
    });
    const byLabelSelector = hcloud.getStorageBoxSubaccounts({
        storageBoxId: storageBoxId,
        withSelector: "team=billing",
    });
    
    import pulumi
    import pulumi_hcloud as hcloud
    
    config = pulumi.Config()
    storage_box_id = config.require_object("storageBoxId")
    all = hcloud.get_storage_box_subaccounts(storage_box_id=storage_box_id)
    by_label_selector = hcloud.get_storage_box_subaccounts(storage_box_id=storage_box_id,
        with_selector="team=billing")
    
    package main
    
    import (
    	"github.com/pulumi/pulumi-hcloud/sdk/go/hcloud"
    	"github.com/pulumi/pulumi/sdk/v3/go/pulumi"
    	"github.com/pulumi/pulumi/sdk/v3/go/pulumi/config"
    )
    
    func main() {
    	pulumi.Run(func(ctx *pulumi.Context) error {
    		cfg := config.New(ctx, "")
    		storageBoxId := cfg.RequireObject("storageBoxId")
    		_, err := hcloud.GetStorageBoxSubaccounts(ctx, &hcloud.GetStorageBoxSubaccountsArgs{
    			StorageBoxId: storageBoxId,
    		}, nil)
    		if err != nil {
    			return err
    		}
    		_, err = hcloud.GetStorageBoxSubaccounts(ctx, &hcloud.GetStorageBoxSubaccountsArgs{
    			StorageBoxId: storageBoxId,
    			WithSelector: pulumi.StringRef("team=billing"),
    		}, 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 config = new Config();
        var storageBoxId = config.RequireObject<dynamic>("storageBoxId");
        var all = HCloud.GetStorageBoxSubaccounts.Invoke(new()
        {
            StorageBoxId = storageBoxId,
        });
    
        var byLabelSelector = HCloud.GetStorageBoxSubaccounts.Invoke(new()
        {
            StorageBoxId = storageBoxId,
            WithSelector = "team=billing",
        });
    
    });
    
    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.GetStorageBoxSubaccountsArgs;
    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 config = ctx.config();
            final var storageBoxId = config.get("storageBoxId");
            final var all = HcloudFunctions.getStorageBoxSubaccounts(GetStorageBoxSubaccountsArgs.builder()
                .storageBoxId(storageBoxId)
                .build());
    
            final var byLabelSelector = HcloudFunctions.getStorageBoxSubaccounts(GetStorageBoxSubaccountsArgs.builder()
                .storageBoxId(storageBoxId)
                .withSelector("team=billing")
                .build());
    
        }
    }
    
    configuration:
      storageBoxId:
        type: dynamic
    variables:
      all:
        fn::invoke:
          function: hcloud:getStorageBoxSubaccounts
          arguments:
            storageBoxId: ${storageBoxId}
      byLabelSelector:
        fn::invoke:
          function: hcloud:getStorageBoxSubaccounts
          arguments:
            storageBoxId: ${storageBoxId}
            withSelector: team=billing
    

    Using getStorageBoxSubaccounts

    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 getStorageBoxSubaccounts(args: GetStorageBoxSubaccountsArgs, opts?: InvokeOptions): Promise<GetStorageBoxSubaccountsResult>
    function getStorageBoxSubaccountsOutput(args: GetStorageBoxSubaccountsOutputArgs, opts?: InvokeOptions): Output<GetStorageBoxSubaccountsResult>
    def get_storage_box_subaccounts(storage_box_id: Optional[int] = None,
                                    with_selector: Optional[str] = None,
                                    opts: Optional[InvokeOptions] = None) -> GetStorageBoxSubaccountsResult
    def get_storage_box_subaccounts_output(storage_box_id: Optional[pulumi.Input[int]] = None,
                                    with_selector: Optional[pulumi.Input[str]] = None,
                                    opts: Optional[InvokeOptions] = None) -> Output[GetStorageBoxSubaccountsResult]
    func GetStorageBoxSubaccounts(ctx *Context, args *GetStorageBoxSubaccountsArgs, opts ...InvokeOption) (*GetStorageBoxSubaccountsResult, error)
    func GetStorageBoxSubaccountsOutput(ctx *Context, args *GetStorageBoxSubaccountsOutputArgs, opts ...InvokeOption) GetStorageBoxSubaccountsResultOutput

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

    public static class GetStorageBoxSubaccounts 
    {
        public static Task<GetStorageBoxSubaccountsResult> InvokeAsync(GetStorageBoxSubaccountsArgs args, InvokeOptions? opts = null)
        public static Output<GetStorageBoxSubaccountsResult> Invoke(GetStorageBoxSubaccountsInvokeArgs args, InvokeOptions? opts = null)
    }
    public static CompletableFuture<GetStorageBoxSubaccountsResult> getStorageBoxSubaccounts(GetStorageBoxSubaccountsArgs args, InvokeOptions options)
    public static Output<GetStorageBoxSubaccountsResult> getStorageBoxSubaccounts(GetStorageBoxSubaccountsArgs args, InvokeOptions options)
    
    fn::invoke:
      function: hcloud:index/getStorageBoxSubaccounts:getStorageBoxSubaccounts
      arguments:
        # arguments dictionary

    The following arguments are supported:

    StorageBoxId int
    ID of the Storage Box.
    WithSelector string
    Filter results using a Label Selector
    StorageBoxId int
    ID of the Storage Box.
    WithSelector string
    Filter results using a Label Selector
    storageBoxId Integer
    ID of the Storage Box.
    withSelector String
    Filter results using a Label Selector
    storageBoxId number
    ID of the Storage Box.
    withSelector string
    Filter results using a Label Selector
    storage_box_id int
    ID of the Storage Box.
    with_selector str
    Filter results using a Label Selector
    storageBoxId Number
    ID of the Storage Box.
    withSelector String
    Filter results using a Label Selector

    getStorageBoxSubaccounts Result

    The following output properties are available:

    Id string
    The provider-assigned unique ID for this managed resource.
    StorageBoxId int
    ID of the Storage Box.
    Subaccounts List<Pulumi.HCloud.Outputs.GetStorageBoxSubaccountsSubaccount>
    WithSelector string
    Filter results using a Label Selector
    Id string
    The provider-assigned unique ID for this managed resource.
    StorageBoxId int
    ID of the Storage Box.
    Subaccounts []GetStorageBoxSubaccountsSubaccount
    WithSelector string
    Filter results using a Label Selector
    id String
    The provider-assigned unique ID for this managed resource.
    storageBoxId Integer
    ID of the Storage Box.
    subaccounts List<GetStorageBoxSubaccountsSubaccount>
    withSelector String
    Filter results using a Label Selector
    id string
    The provider-assigned unique ID for this managed resource.
    storageBoxId number
    ID of the Storage Box.
    subaccounts GetStorageBoxSubaccountsSubaccount[]
    withSelector string
    Filter results using a Label Selector
    id str
    The provider-assigned unique ID for this managed resource.
    storage_box_id int
    ID of the Storage Box.
    subaccounts Sequence[GetStorageBoxSubaccountsSubaccount]
    with_selector str
    Filter results using a Label Selector
    id String
    The provider-assigned unique ID for this managed resource.
    storageBoxId Number
    ID of the Storage Box.
    subaccounts List<Property Map>
    withSelector String
    Filter results using a Label Selector

    Supporting Types

    GetStorageBoxSubaccountsSubaccount

    AccessSettings Pulumi.HCloud.Inputs.GetStorageBoxSubaccountsSubaccountAccessSettings
    Access settings for the Subaccount.
    Description string
    Description of the Storage Box Subaccount.
    HomeDirectory string
    Home directory of the Storage Box Subaccount.
    Id int
    ID of the Storage Box Subaccount.
    Labels Dictionary<string, string>
    User-defined labels (key-value pairs) for the resource.
    Server string
    FQDN of the Storage Box Subaccount.
    StorageBoxId int
    ID of the Storage Box.
    Username string
    Username of the Storage Box Subaccount.
    AccessSettings GetStorageBoxSubaccountsSubaccountAccessSettings
    Access settings for the Subaccount.
    Description string
    Description of the Storage Box Subaccount.
    HomeDirectory string
    Home directory of the Storage Box Subaccount.
    Id int
    ID of the Storage Box Subaccount.
    Labels map[string]string
    User-defined labels (key-value pairs) for the resource.
    Server string
    FQDN of the Storage Box Subaccount.
    StorageBoxId int
    ID of the Storage Box.
    Username string
    Username of the Storage Box Subaccount.
    accessSettings GetStorageBoxSubaccountsSubaccountAccessSettings
    Access settings for the Subaccount.
    description String
    Description of the Storage Box Subaccount.
    homeDirectory String
    Home directory of the Storage Box Subaccount.
    id Integer
    ID of the Storage Box Subaccount.
    labels Map<String,String>
    User-defined labels (key-value pairs) for the resource.
    server String
    FQDN of the Storage Box Subaccount.
    storageBoxId Integer
    ID of the Storage Box.
    username String
    Username of the Storage Box Subaccount.
    accessSettings GetStorageBoxSubaccountsSubaccountAccessSettings
    Access settings for the Subaccount.
    description string
    Description of the Storage Box Subaccount.
    homeDirectory string
    Home directory of the Storage Box Subaccount.
    id number
    ID of the Storage Box Subaccount.
    labels {[key: string]: string}
    User-defined labels (key-value pairs) for the resource.
    server string
    FQDN of the Storage Box Subaccount.
    storageBoxId number
    ID of the Storage Box.
    username string
    Username of the Storage Box Subaccount.
    access_settings GetStorageBoxSubaccountsSubaccountAccessSettings
    Access settings for the Subaccount.
    description str
    Description of the Storage Box Subaccount.
    home_directory str
    Home directory of the Storage Box Subaccount.
    id int
    ID of the Storage Box Subaccount.
    labels Mapping[str, str]
    User-defined labels (key-value pairs) for the resource.
    server str
    FQDN of the Storage Box Subaccount.
    storage_box_id int
    ID of the Storage Box.
    username str
    Username of the Storage Box Subaccount.
    accessSettings Property Map
    Access settings for the Subaccount.
    description String
    Description of the Storage Box Subaccount.
    homeDirectory String
    Home directory of the Storage Box Subaccount.
    id Number
    ID of the Storage Box Subaccount.
    labels Map<String>
    User-defined labels (key-value pairs) for the resource.
    server String
    FQDN of the Storage Box Subaccount.
    storageBoxId Number
    ID of the Storage Box.
    username String
    Username of the Storage Box Subaccount.

    GetStorageBoxSubaccountsSubaccountAccessSettings

    ReachableExternally bool
    Whether access from outside the Hetzner network is allowed.
    Readonly bool
    Whether the Subaccount is read-only.
    SambaEnabled bool
    Whether the Samba subsystem is enabled.
    SshEnabled bool
    Whether the SSH subsystem is enabled.
    WebdavEnabled bool
    Whether the WebDAV subsystem is enabled.
    ReachableExternally bool
    Whether access from outside the Hetzner network is allowed.
    Readonly bool
    Whether the Subaccount is read-only.
    SambaEnabled bool
    Whether the Samba subsystem is enabled.
    SshEnabled bool
    Whether the SSH subsystem is enabled.
    WebdavEnabled bool
    Whether the WebDAV subsystem is enabled.
    reachableExternally Boolean
    Whether access from outside the Hetzner network is allowed.
    readonly Boolean
    Whether the Subaccount is read-only.
    sambaEnabled Boolean
    Whether the Samba subsystem is enabled.
    sshEnabled Boolean
    Whether the SSH subsystem is enabled.
    webdavEnabled Boolean
    Whether the WebDAV subsystem is enabled.
    reachableExternally boolean
    Whether access from outside the Hetzner network is allowed.
    readonly boolean
    Whether the Subaccount is read-only.
    sambaEnabled boolean
    Whether the Samba subsystem is enabled.
    sshEnabled boolean
    Whether the SSH subsystem is enabled.
    webdavEnabled boolean
    Whether the WebDAV subsystem is enabled.
    reachable_externally bool
    Whether access from outside the Hetzner network is allowed.
    readonly bool
    Whether the Subaccount is read-only.
    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.
    reachableExternally Boolean
    Whether access from outside the Hetzner network is allowed.
    readonly Boolean
    Whether the Subaccount is read-only.
    sambaEnabled Boolean
    Whether the Samba subsystem is enabled.
    sshEnabled Boolean
    Whether the SSH subsystem is enabled.
    webdavEnabled Boolean
    Whether the WebDAV subsystem is enabled.

    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