1. Packages
  2. Hcloud Provider
  3. API Docs
  4. getStorageBoxSubaccount
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 byId = hcloud.getStorageBoxSubaccount({
        storageBoxId: storageBoxId,
        id: 2,
    });
    const byUsername = hcloud.getStorageBoxSubaccount({
        storageBoxId: storageBoxId,
        username: "u507137-sub1",
    });
    const byLabelSelector = hcloud.getStorageBoxSubaccount({
        storageBoxId: storageBoxId,
        withSelector: "team=billing",
    });
    
    import pulumi
    import pulumi_hcloud as hcloud
    
    config = pulumi.Config()
    storage_box_id = config.require_object("storageBoxId")
    by_id = hcloud.get_storage_box_subaccount(storage_box_id=storage_box_id,
        id=2)
    by_username = hcloud.get_storage_box_subaccount(storage_box_id=storage_box_id,
        username="u507137-sub1")
    by_label_selector = hcloud.get_storage_box_subaccount(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.LookupStorageBoxSubaccount(ctx, &hcloud.LookupStorageBoxSubaccountArgs{
    			StorageBoxId: storageBoxId,
    			Id:           pulumi.IntRef(2),
    		}, nil)
    		if err != nil {
    			return err
    		}
    		_, err = hcloud.LookupStorageBoxSubaccount(ctx, &hcloud.LookupStorageBoxSubaccountArgs{
    			StorageBoxId: storageBoxId,
    			Username:     pulumi.StringRef("u507137-sub1"),
    		}, nil)
    		if err != nil {
    			return err
    		}
    		_, err = hcloud.LookupStorageBoxSubaccount(ctx, &hcloud.LookupStorageBoxSubaccountArgs{
    			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 byId = HCloud.GetStorageBoxSubaccount.Invoke(new()
        {
            StorageBoxId = storageBoxId,
            Id = 2,
        });
    
        var byUsername = HCloud.GetStorageBoxSubaccount.Invoke(new()
        {
            StorageBoxId = storageBoxId,
            Username = "u507137-sub1",
        });
    
        var byLabelSelector = HCloud.GetStorageBoxSubaccount.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.GetStorageBoxSubaccountArgs;
    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 byId = HcloudFunctions.getStorageBoxSubaccount(GetStorageBoxSubaccountArgs.builder()
                .storageBoxId(storageBoxId)
                .id(2)
                .build());
    
            final var byUsername = HcloudFunctions.getStorageBoxSubaccount(GetStorageBoxSubaccountArgs.builder()
                .storageBoxId(storageBoxId)
                .username("u507137-sub1")
                .build());
    
            final var byLabelSelector = HcloudFunctions.getStorageBoxSubaccount(GetStorageBoxSubaccountArgs.builder()
                .storageBoxId(storageBoxId)
                .withSelector("team=billing")
                .build());
    
        }
    }
    
    configuration:
      storageBoxId:
        type: dynamic
    variables:
      byId:
        fn::invoke:
          function: hcloud:getStorageBoxSubaccount
          arguments:
            storageBoxId: ${storageBoxId}
            id: 2
      byUsername:
        fn::invoke:
          function: hcloud:getStorageBoxSubaccount
          arguments:
            storageBoxId: ${storageBoxId}
            username: u507137-sub1
      byLabelSelector:
        fn::invoke:
          function: hcloud:getStorageBoxSubaccount
          arguments:
            storageBoxId: ${storageBoxId}
            withSelector: team=billing
    

    Using getStorageBoxSubaccount

    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 getStorageBoxSubaccount(args: GetStorageBoxSubaccountArgs, opts?: InvokeOptions): Promise<GetStorageBoxSubaccountResult>
    function getStorageBoxSubaccountOutput(args: GetStorageBoxSubaccountOutputArgs, opts?: InvokeOptions): Output<GetStorageBoxSubaccountResult>
    def get_storage_box_subaccount(id: Optional[int] = None,
                                   storage_box_id: Optional[int] = None,
                                   username: Optional[str] = None,
                                   with_selector: Optional[str] = None,
                                   opts: Optional[InvokeOptions] = None) -> GetStorageBoxSubaccountResult
    def get_storage_box_subaccount_output(id: Optional[pulumi.Input[int]] = None,
                                   storage_box_id: Optional[pulumi.Input[int]] = None,
                                   username: Optional[pulumi.Input[str]] = None,
                                   with_selector: Optional[pulumi.Input[str]] = None,
                                   opts: Optional[InvokeOptions] = None) -> Output[GetStorageBoxSubaccountResult]
    func LookupStorageBoxSubaccount(ctx *Context, args *LookupStorageBoxSubaccountArgs, opts ...InvokeOption) (*LookupStorageBoxSubaccountResult, error)
    func LookupStorageBoxSubaccountOutput(ctx *Context, args *LookupStorageBoxSubaccountOutputArgs, opts ...InvokeOption) LookupStorageBoxSubaccountResultOutput

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

    public static class GetStorageBoxSubaccount 
    {
        public static Task<GetStorageBoxSubaccountResult> InvokeAsync(GetStorageBoxSubaccountArgs args, InvokeOptions? opts = null)
        public static Output<GetStorageBoxSubaccountResult> Invoke(GetStorageBoxSubaccountInvokeArgs args, InvokeOptions? opts = null)
    }
    public static CompletableFuture<GetStorageBoxSubaccountResult> getStorageBoxSubaccount(GetStorageBoxSubaccountArgs args, InvokeOptions options)
    public static Output<GetStorageBoxSubaccountResult> getStorageBoxSubaccount(GetStorageBoxSubaccountArgs args, InvokeOptions options)
    
    fn::invoke:
      function: hcloud:index/getStorageBoxSubaccount:getStorageBoxSubaccount
      arguments:
        # arguments dictionary

    The following arguments are supported:

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

    getStorageBoxSubaccount Result

    The following output properties are available:

    AccessSettings Pulumi.HCloud.Outputs.GetStorageBoxSubaccountAccessSettings
    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.
    WithSelector string
    Filter results using a Label Selector.
    AccessSettings GetStorageBoxSubaccountAccessSettings
    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.
    WithSelector string
    Filter results using a Label Selector.
    accessSettings GetStorageBoxSubaccountAccessSettings
    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.
    withSelector String
    Filter results using a Label Selector.
    accessSettings GetStorageBoxSubaccountAccessSettings
    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.
    withSelector string
    Filter results using a Label Selector.
    access_settings GetStorageBoxSubaccountAccessSettings
    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.
    with_selector str
    Filter results using a Label Selector.
    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.
    withSelector String
    Filter results using a Label Selector.

    Supporting Types

    GetStorageBoxSubaccountAccessSettings

    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