1. Packages
  2. Hcloud Provider
  3. API Docs
  4. StorageBoxSubaccount
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 teamBadgerPassword = config.require("teamBadgerPassword");
    const main = new hcloud.StorageBox("main", {});
    const teamBadger = new hcloud.StorageBoxSubaccount("team_badger", {
        storageBoxId: main.id,
        homeDirectory: "teams/badger/",
        password: teamBadgerPassword,
        accessSettings: {
            reachableExternally: true,
            sambaEnabled: true,
        },
        description: "Primary account for the Badger team to upload files.",
        labels: {
            env: "production",
            team: "badger",
        },
    });
    
    import pulumi
    import pulumi_hcloud as hcloud
    
    config = pulumi.Config()
    team_badger_password = config.require("teamBadgerPassword")
    main = hcloud.StorageBox("main")
    team_badger = hcloud.StorageBoxSubaccount("team_badger",
        storage_box_id=main.id,
        home_directory="teams/badger/",
        password=team_badger_password,
        access_settings={
            "reachable_externally": True,
            "samba_enabled": True,
        },
        description="Primary account for the Badger team to upload files.",
        labels={
            "env": "production",
            "team": "badger",
        })
    
    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, "")
    		teamBadgerPassword := cfg.Require("teamBadgerPassword")
    		main, err := hcloud.NewStorageBox(ctx, "main", nil)
    		if err != nil {
    			return err
    		}
    		_, err = hcloud.NewStorageBoxSubaccount(ctx, "team_badger", &hcloud.StorageBoxSubaccountArgs{
    			StorageBoxId:  main.ID(),
    			HomeDirectory: pulumi.String("teams/badger/"),
    			Password:      pulumi.String(teamBadgerPassword),
    			AccessSettings: &hcloud.StorageBoxSubaccountAccessSettingsArgs{
    				ReachableExternally: pulumi.Bool(true),
    				SambaEnabled:        pulumi.Bool(true),
    			},
    			Description: pulumi.String("Primary account for the Badger team to upload files."),
    			Labels: pulumi.StringMap{
    				"env":  pulumi.String("production"),
    				"team": pulumi.String("badger"),
    			},
    		})
    		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 teamBadgerPassword = config.Require("teamBadgerPassword");
        var main = new HCloud.StorageBox("main");
    
        var teamBadger = new HCloud.StorageBoxSubaccount("team_badger", new()
        {
            StorageBoxId = main.Id,
            HomeDirectory = "teams/badger/",
            Password = teamBadgerPassword,
            AccessSettings = new HCloud.Inputs.StorageBoxSubaccountAccessSettingsArgs
            {
                ReachableExternally = true,
                SambaEnabled = true,
            },
            Description = "Primary account for the Badger team to upload files.",
            Labels = 
            {
                { "env", "production" },
                { "team", "badger" },
            },
        });
    
    });
    
    package generated_program;
    
    import com.pulumi.Context;
    import com.pulumi.Pulumi;
    import com.pulumi.core.Output;
    import com.pulumi.hcloud.StorageBox;
    import com.pulumi.hcloud.StorageBoxSubaccount;
    import com.pulumi.hcloud.StorageBoxSubaccountArgs;
    import com.pulumi.hcloud.inputs.StorageBoxSubaccountAccessSettingsArgs;
    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 teamBadgerPassword = config.get("teamBadgerPassword");
            var main = new StorageBox("main");
    
            var teamBadger = new StorageBoxSubaccount("teamBadger", StorageBoxSubaccountArgs.builder()
                .storageBoxId(main.id())
                .homeDirectory("teams/badger/")
                .password(teamBadgerPassword)
                .accessSettings(StorageBoxSubaccountAccessSettingsArgs.builder()
                    .reachableExternally(true)
                    .sambaEnabled(true)
                    .build())
                .description("Primary account for the Badger team to upload files.")
                .labels(Map.ofEntries(
                    Map.entry("env", "production"),
                    Map.entry("team", "badger")
                ))
                .build());
    
        }
    }
    
    configuration:
      teamBadgerPassword:
        type: string
    resources:
      main:
        type: hcloud:StorageBox
      teamBadger:
        type: hcloud:StorageBoxSubaccount
        name: team_badger
        properties:
          storageBoxId: ${main.id}
          homeDirectory: teams/badger/
          password: ${teamBadgerPassword}
          accessSettings:
            reachableExternally: true
            sambaEnabled: true
          description: Primary account for the Badger team to upload files.
          labels:
            env: production
            team: badger
    

    Create StorageBoxSubaccount Resource

    Resources are created with functions called constructors. To learn more about declaring and configuring resources, see Resources.

    Constructor syntax

    new StorageBoxSubaccount(name: string, args: StorageBoxSubaccountArgs, opts?: CustomResourceOptions);
    @overload
    def StorageBoxSubaccount(resource_name: str,
                             args: StorageBoxSubaccountArgs,
                             opts: Optional[ResourceOptions] = None)
    
    @overload
    def StorageBoxSubaccount(resource_name: str,
                             opts: Optional[ResourceOptions] = None,
                             home_directory: Optional[str] = None,
                             password: Optional[str] = None,
                             storage_box_id: Optional[int] = None,
                             access_settings: Optional[StorageBoxSubaccountAccessSettingsArgs] = None,
                             description: Optional[str] = None,
                             labels: Optional[Mapping[str, str]] = None)
    func NewStorageBoxSubaccount(ctx *Context, name string, args StorageBoxSubaccountArgs, opts ...ResourceOption) (*StorageBoxSubaccount, error)
    public StorageBoxSubaccount(string name, StorageBoxSubaccountArgs args, CustomResourceOptions? opts = null)
    public StorageBoxSubaccount(String name, StorageBoxSubaccountArgs args)
    public StorageBoxSubaccount(String name, StorageBoxSubaccountArgs args, CustomResourceOptions options)
    
    type: hcloud:StorageBoxSubaccount
    properties: # The arguments to resource properties.
    options: # Bag of options to control resource's behavior.
    
    

    Parameters

    name string
    The unique name of the resource.
    args StorageBoxSubaccountArgs
    The arguments to resource properties.
    opts CustomResourceOptions
    Bag of options to control resource's behavior.
    resource_name str
    The unique name of the resource.
    args StorageBoxSubaccountArgs
    The arguments to resource properties.
    opts ResourceOptions
    Bag of options to control resource's behavior.
    ctx Context
    Context object for the current deployment.
    name string
    The unique name of the resource.
    args StorageBoxSubaccountArgs
    The arguments to resource properties.
    opts ResourceOption
    Bag of options to control resource's behavior.
    name string
    The unique name of the resource.
    args StorageBoxSubaccountArgs
    The arguments to resource properties.
    opts CustomResourceOptions
    Bag of options to control resource's behavior.
    name String
    The unique name of the resource.
    args StorageBoxSubaccountArgs
    The arguments to resource properties.
    options CustomResourceOptions
    Bag of options to control resource's behavior.

    Constructor example

    The following reference example uses placeholder values for all input properties.

    var storageBoxSubaccountResource = new HCloud.StorageBoxSubaccount("storageBoxSubaccountResource", new()
    {
        HomeDirectory = "string",
        Password = "string",
        StorageBoxId = 0,
        AccessSettings = new HCloud.Inputs.StorageBoxSubaccountAccessSettingsArgs
        {
            ReachableExternally = false,
            Readonly = false,
            SambaEnabled = false,
            SshEnabled = false,
            WebdavEnabled = false,
        },
        Description = "string",
        Labels = 
        {
            { "string", "string" },
        },
    });
    
    example, err := hcloud.NewStorageBoxSubaccount(ctx, "storageBoxSubaccountResource", &hcloud.StorageBoxSubaccountArgs{
    	HomeDirectory: pulumi.String("string"),
    	Password:      pulumi.String("string"),
    	StorageBoxId:  pulumi.Int(0),
    	AccessSettings: &hcloud.StorageBoxSubaccountAccessSettingsArgs{
    		ReachableExternally: pulumi.Bool(false),
    		Readonly:            pulumi.Bool(false),
    		SambaEnabled:        pulumi.Bool(false),
    		SshEnabled:          pulumi.Bool(false),
    		WebdavEnabled:       pulumi.Bool(false),
    	},
    	Description: pulumi.String("string"),
    	Labels: pulumi.StringMap{
    		"string": pulumi.String("string"),
    	},
    })
    
    var storageBoxSubaccountResource = new StorageBoxSubaccount("storageBoxSubaccountResource", StorageBoxSubaccountArgs.builder()
        .homeDirectory("string")
        .password("string")
        .storageBoxId(0)
        .accessSettings(StorageBoxSubaccountAccessSettingsArgs.builder()
            .reachableExternally(false)
            .readonly(false)
            .sambaEnabled(false)
            .sshEnabled(false)
            .webdavEnabled(false)
            .build())
        .description("string")
        .labels(Map.of("string", "string"))
        .build());
    
    storage_box_subaccount_resource = hcloud.StorageBoxSubaccount("storageBoxSubaccountResource",
        home_directory="string",
        password="string",
        storage_box_id=0,
        access_settings={
            "reachable_externally": False,
            "readonly": False,
            "samba_enabled": False,
            "ssh_enabled": False,
            "webdav_enabled": False,
        },
        description="string",
        labels={
            "string": "string",
        })
    
    const storageBoxSubaccountResource = new hcloud.StorageBoxSubaccount("storageBoxSubaccountResource", {
        homeDirectory: "string",
        password: "string",
        storageBoxId: 0,
        accessSettings: {
            reachableExternally: false,
            readonly: false,
            sambaEnabled: false,
            sshEnabled: false,
            webdavEnabled: false,
        },
        description: "string",
        labels: {
            string: "string",
        },
    });
    
    type: hcloud:StorageBoxSubaccount
    properties:
        accessSettings:
            reachableExternally: false
            readonly: false
            sambaEnabled: false
            sshEnabled: false
            webdavEnabled: false
        description: string
        homeDirectory: string
        labels:
            string: string
        password: string
        storageBoxId: 0
    

    StorageBoxSubaccount Resource Properties

    To learn more about resource properties and how to use them, see Inputs and Outputs in the Architecture and Concepts docs.

    Inputs

    In Python, inputs that are objects can be passed either as argument classes or as dictionary literals.

    The StorageBoxSubaccount resource accepts the following input properties:

    HomeDirectory string
    Home directory of the Storage Box Subaccount. The directory will be created if it doesn't exist yet.
    Password string
    Password of the Storage Box. For more details, see the Storage Boxes password policy.
    StorageBoxId int
    ID of the Storage Box.
    AccessSettings Pulumi.HCloud.Inputs.StorageBoxSubaccountAccessSettings
    Access settings for the Subaccount.
    Description string
    A description of the Storage Box Subaccount.
    Labels Dictionary<string, string>
    User-defined labels (key-value pairs) for the resource.
    HomeDirectory string
    Home directory of the Storage Box Subaccount. The directory will be created if it doesn't exist yet.
    Password string
    Password of the Storage Box. For more details, see the Storage Boxes password policy.
    StorageBoxId int
    ID of the Storage Box.
    AccessSettings StorageBoxSubaccountAccessSettingsArgs
    Access settings for the Subaccount.
    Description string
    A description of the Storage Box Subaccount.
    Labels map[string]string
    User-defined labels (key-value pairs) for the resource.
    homeDirectory String
    Home directory of the Storage Box Subaccount. The directory will be created if it doesn't exist yet.
    password String
    Password of the Storage Box. For more details, see the Storage Boxes password policy.
    storageBoxId Integer
    ID of the Storage Box.
    accessSettings StorageBoxSubaccountAccessSettings
    Access settings for the Subaccount.
    description String
    A description of the Storage Box Subaccount.
    labels Map<String,String>
    User-defined labels (key-value pairs) for the resource.
    homeDirectory string
    Home directory of the Storage Box Subaccount. The directory will be created if it doesn't exist yet.
    password string
    Password of the Storage Box. For more details, see the Storage Boxes password policy.
    storageBoxId number
    ID of the Storage Box.
    accessSettings StorageBoxSubaccountAccessSettings
    Access settings for the Subaccount.
    description string
    A description of the Storage Box Subaccount.
    labels {[key: string]: string}
    User-defined labels (key-value pairs) for the resource.
    home_directory str
    Home directory of the Storage Box Subaccount. The directory will be created if it doesn't exist yet.
    password str
    Password of the Storage Box. For more details, see the Storage Boxes password policy.
    storage_box_id int
    ID of the Storage Box.
    access_settings StorageBoxSubaccountAccessSettingsArgs
    Access settings for the Subaccount.
    description str
    A description of the Storage Box Subaccount.
    labels Mapping[str, str]
    User-defined labels (key-value pairs) for the resource.
    homeDirectory String
    Home directory of the Storage Box Subaccount. The directory will be created if it doesn't exist yet.
    password String
    Password of the Storage Box. For more details, see the Storage Boxes password policy.
    storageBoxId Number
    ID of the Storage Box.
    accessSettings Property Map
    Access settings for the Subaccount.
    description String
    A description of the Storage Box Subaccount.
    labels Map<String>
    User-defined labels (key-value pairs) for the resource.

    Outputs

    All input properties are implicitly available as output properties. Additionally, the StorageBoxSubaccount resource produces the following output properties:

    Id string
    The provider-assigned unique ID for this managed resource.
    Server string
    FQDN of the Storage Box Subaccount.
    Username string
    Username of the Storage Box Subaccount.
    Id string
    The provider-assigned unique ID for this managed resource.
    Server string
    FQDN of the Storage Box Subaccount.
    Username string
    Username of the Storage Box Subaccount.
    id String
    The provider-assigned unique ID for this managed resource.
    server String
    FQDN of the Storage Box Subaccount.
    username String
    Username of the Storage Box Subaccount.
    id string
    The provider-assigned unique ID for this managed resource.
    server string
    FQDN of the Storage Box Subaccount.
    username string
    Username of the Storage Box Subaccount.
    id str
    The provider-assigned unique ID for this managed resource.
    server str
    FQDN of the Storage Box Subaccount.
    username str
    Username of the Storage Box Subaccount.
    id String
    The provider-assigned unique ID for this managed resource.
    server String
    FQDN of the Storage Box Subaccount.
    username String
    Username of the Storage Box Subaccount.

    Look up Existing StorageBoxSubaccount Resource

    Get an existing StorageBoxSubaccount resource’s state with the given name, ID, and optional extra properties used to qualify the lookup.

    public static get(name: string, id: Input<ID>, state?: StorageBoxSubaccountState, opts?: CustomResourceOptions): StorageBoxSubaccount
    @staticmethod
    def get(resource_name: str,
            id: str,
            opts: Optional[ResourceOptions] = None,
            access_settings: Optional[StorageBoxSubaccountAccessSettingsArgs] = None,
            description: Optional[str] = None,
            home_directory: Optional[str] = None,
            labels: Optional[Mapping[str, str]] = None,
            password: Optional[str] = None,
            server: Optional[str] = None,
            storage_box_id: Optional[int] = None,
            username: Optional[str] = None) -> StorageBoxSubaccount
    func GetStorageBoxSubaccount(ctx *Context, name string, id IDInput, state *StorageBoxSubaccountState, opts ...ResourceOption) (*StorageBoxSubaccount, error)
    public static StorageBoxSubaccount Get(string name, Input<string> id, StorageBoxSubaccountState? state, CustomResourceOptions? opts = null)
    public static StorageBoxSubaccount get(String name, Output<String> id, StorageBoxSubaccountState state, CustomResourceOptions options)
    resources:  _:    type: hcloud:StorageBoxSubaccount    get:      id: ${id}
    name
    The unique name of the resulting resource.
    id
    The unique provider ID of the resource to lookup.
    state
    Any extra arguments used during the lookup.
    opts
    A bag of options that control this resource's behavior.
    resource_name
    The unique name of the resulting resource.
    id
    The unique provider ID of the resource to lookup.
    name
    The unique name of the resulting resource.
    id
    The unique provider ID of the resource to lookup.
    state
    Any extra arguments used during the lookup.
    opts
    A bag of options that control this resource's behavior.
    name
    The unique name of the resulting resource.
    id
    The unique provider ID of the resource to lookup.
    state
    Any extra arguments used during the lookup.
    opts
    A bag of options that control this resource's behavior.
    name
    The unique name of the resulting resource.
    id
    The unique provider ID of the resource to lookup.
    state
    Any extra arguments used during the lookup.
    opts
    A bag of options that control this resource's behavior.
    The following state arguments are supported:
    AccessSettings Pulumi.HCloud.Inputs.StorageBoxSubaccountAccessSettings
    Access settings for the Subaccount.
    Description string
    A description of the Storage Box Subaccount.
    HomeDirectory string
    Home directory of the Storage Box Subaccount. The directory will be created if it doesn't exist yet.
    Labels Dictionary<string, string>
    User-defined labels (key-value pairs) for the resource.
    Password string
    Password of the Storage Box. For more details, see the Storage Boxes password policy.
    Server string
    FQDN of the Storage Box Subaccount.
    StorageBoxId int
    ID of the Storage Box.
    Username string
    Username of the Storage Box Subaccount.
    AccessSettings StorageBoxSubaccountAccessSettingsArgs
    Access settings for the Subaccount.
    Description string
    A description of the Storage Box Subaccount.
    HomeDirectory string
    Home directory of the Storage Box Subaccount. The directory will be created if it doesn't exist yet.
    Labels map[string]string
    User-defined labels (key-value pairs) for the resource.
    Password string
    Password of the Storage Box. For more details, see the Storage Boxes password policy.
    Server string
    FQDN of the Storage Box Subaccount.
    StorageBoxId int
    ID of the Storage Box.
    Username string
    Username of the Storage Box Subaccount.
    accessSettings StorageBoxSubaccountAccessSettings
    Access settings for the Subaccount.
    description String
    A description of the Storage Box Subaccount.
    homeDirectory String
    Home directory of the Storage Box Subaccount. The directory will be created if it doesn't exist yet.
    labels Map<String,String>
    User-defined labels (key-value pairs) for the resource.
    password String
    Password of the Storage Box. For more details, see the Storage Boxes password policy.
    server String
    FQDN of the Storage Box Subaccount.
    storageBoxId Integer
    ID of the Storage Box.
    username String
    Username of the Storage Box Subaccount.
    accessSettings StorageBoxSubaccountAccessSettings
    Access settings for the Subaccount.
    description string
    A description of the Storage Box Subaccount.
    homeDirectory string
    Home directory of the Storage Box Subaccount. The directory will be created if it doesn't exist yet.
    labels {[key: string]: string}
    User-defined labels (key-value pairs) for the resource.
    password string
    Password of the Storage Box. For more details, see the Storage Boxes password policy.
    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 StorageBoxSubaccountAccessSettingsArgs
    Access settings for the Subaccount.
    description str
    A description of the Storage Box Subaccount.
    home_directory str
    Home directory of the Storage Box Subaccount. The directory will be created if it doesn't exist yet.
    labels Mapping[str, str]
    User-defined labels (key-value pairs) for the resource.
    password str
    Password of the Storage Box. For more details, see the Storage Boxes password policy.
    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
    A description of the Storage Box Subaccount.
    homeDirectory String
    Home directory of the Storage Box Subaccount. The directory will be created if it doesn't exist yet.
    labels Map<String>
    User-defined labels (key-value pairs) for the resource.
    password String
    Password of the Storage Box. For more details, see the Storage Boxes password policy.
    server String
    FQDN of the Storage Box Subaccount.
    storageBoxId Number
    ID of the Storage Box.
    username String
    Username of the Storage Box Subaccount.

    Supporting Types

    StorageBoxSubaccountAccessSettings, StorageBoxSubaccountAccessSettingsArgs

    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.

    Import

    In Terraform v1.5.0 and later, the import block can be used with the id attribute, for example:

    terraform

    import {

    to = hcloud_storage_box_subaccount.example

    id = “$STORAGE_BOX_ID/$STORAGE_BOX_SUBACCOUNT_ID”

    }

    The pulumi import command can be used, for example:

    $ pulumi import hcloud:index/storageBoxSubaccount:StorageBoxSubaccount example "$STORAGE_BOX_ID/$STORAGE_BOX_SUBACCOUNT_ID"
    

    To learn more about importing existing cloud resources, see Importing resources.

    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