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:
- Home
Directory 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.
- Storage
Box intId - ID of the Storage Box.
- Access
Settings Pulumi.HCloud. Inputs. Storage Box Subaccount Access Settings - 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.
- Home
Directory 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.
- Storage
Box intId - ID of the Storage Box.
- Access
Settings StorageBox Subaccount Access Settings Args - 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.
- home
Directory 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.
- storage
Box IntegerId - ID of the Storage Box.
- access
Settings StorageBox Subaccount Access Settings - 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.
- home
Directory 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.
- storage
Box numberId - ID of the Storage Box.
- access
Settings StorageBox Subaccount Access Settings - 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_ intid - ID of the Storage Box.
- access_
settings StorageBox Subaccount Access Settings Args - 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.
- home
Directory 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.
- storage
Box NumberId - ID of the Storage Box.
- access
Settings 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:
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) -> StorageBoxSubaccountfunc 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.
- Access
Settings Pulumi.HCloud. Inputs. Storage Box Subaccount Access Settings - Access settings for the Subaccount.
- Description string
- A description of the Storage Box Subaccount.
- Home
Directory 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.
- Storage
Box intId - ID of the Storage Box.
- Username string
- Username of the Storage Box Subaccount.
- Access
Settings StorageBox Subaccount Access Settings Args - Access settings for the Subaccount.
- Description string
- A description of the Storage Box Subaccount.
- Home
Directory 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.
- Storage
Box intId - ID of the Storage Box.
- Username string
- Username of the Storage Box Subaccount.
- access
Settings StorageBox Subaccount Access Settings - Access settings for the Subaccount.
- description String
- A description of the Storage Box Subaccount.
- home
Directory 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.
- storage
Box IntegerId - ID of the Storage Box.
- username String
- Username of the Storage Box Subaccount.
- access
Settings StorageBox Subaccount Access Settings - Access settings for the Subaccount.
- description string
- A description of the Storage Box Subaccount.
- home
Directory 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.
- storage
Box numberId - ID of the Storage Box.
- username string
- Username of the Storage Box Subaccount.
- access_
settings StorageBox Subaccount Access Settings Args - 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_ intid - ID of the Storage Box.
- username str
- Username of the Storage Box Subaccount.
- access
Settings Property Map - Access settings for the Subaccount.
- description String
- A description of the Storage Box Subaccount.
- home
Directory 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.
- storage
Box NumberId - ID of the Storage Box.
- username String
- Username of the Storage Box Subaccount.
Supporting Types
StorageBoxSubaccountAccessSettings, StorageBoxSubaccountAccessSettingsArgs
- 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.
- 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.
- reachable
Externally Boolean - Whether access from outside the Hetzner network is allowed.
- readonly Boolean
- Whether the Subaccount is read-only.
- samba
Enabled Boolean - Whether the Samba subsystem is enabled.
- ssh
Enabled Boolean - Whether the SSH subsystem is enabled.
- webdav
Enabled Boolean - Whether the WebDAV subsystem is enabled.
- reachable
Externally boolean - Whether access from outside the Hetzner network is allowed.
- readonly boolean
- Whether the Subaccount is read-only.
- samba
Enabled boolean - Whether the Samba subsystem is enabled.
- ssh
Enabled boolean - Whether the SSH subsystem is enabled.
- webdav
Enabled 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.
- reachable
Externally Boolean - Whether access from outside the Hetzner network is allowed.
- readonly Boolean
- Whether the Subaccount is read-only.
- samba
Enabled Boolean - Whether the Samba subsystem is enabled.
- ssh
Enabled Boolean - Whether the SSH subsystem is enabled.
- webdav
Enabled 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
hcloudTerraform Provider.
