@pulumi/hcloud
Version:
A Pulumi package for creating and managing hcloud cloud resources.
184 lines • 6.84 kB
TypeScript
import * as pulumi from "@pulumi/pulumi";
/**
* Provides a Hetzner Cloud volume resource to manage volumes.
*
* ## Example Usage
*
* ```typescript
* import * as pulumi from "@pulumi/pulumi";
* import * as hcloud from "@pulumi/hcloud";
*
* const node1 = new hcloud.Server("node1", {
* name: "node1",
* image: "debian-12",
* serverType: "cx23",
* });
* const master = new hcloud.Volume("master", {
* name: "volume1",
* size: 50,
* serverId: node1.id.apply(x =>Number(x)),
* automount: true,
* format: "ext4",
* });
* ```
*
* ## Import
*
* Volumes can be imported using their `id`:
*
* ```sh
* $ pulumi import hcloud:index/volume:Volume example "$VOLUME_ID"
* ```
*/
export declare class Volume extends pulumi.CustomResource {
/**
* Get an existing Volume resource's state with the given name, ID, and optional extra
* properties used to qualify the lookup.
*
* @param name The _unique_ name of the resulting resource.
* @param id The _unique_ provider ID of the resource to lookup.
* @param state Any extra arguments used during the lookup.
* @param opts Optional settings to control the behavior of the CustomResource.
*/
static get(name: string, id: pulumi.Input<pulumi.ID>, state?: VolumeState, opts?: pulumi.CustomResourceOptions): Volume;
/**
* Returns true if the given object is an instance of Volume. This is designed to work even
* when multiple copies of the Pulumi SDK have been loaded into the same process.
*/
static isInstance(obj: any): obj is Volume;
/**
* Automount the volume upon attaching it (server_id must be provided).
*/
readonly automount: pulumi.Output<boolean | undefined>;
/**
* Enable or disable delete protection. See "Delete Protection" in the Provider Docs for details.
*
* **Note:** When you want to attach multiple volumes to a server, please use the `hcloud.VolumeAttachment` resource and the `location` argument instead of the `serverId` argument.
*/
readonly deleteProtection: pulumi.Output<boolean | undefined>;
/**
* Format volume after creation. `xfs` or `ext4`
*/
readonly format: pulumi.Output<string | undefined>;
/**
* User-defined labels (key-value pairs).
*/
readonly labels: pulumi.Output<{
[key: string]: string;
} | undefined>;
/**
* (string) Device path on the file system for the Volume.
*/
readonly linuxDevice: pulumi.Output<string>;
/**
* The location name of the volume to create, not allowed if serverId argument is passed. See the [Hetzner Docs](https://docs.hetzner.com/cloud/general/locations/#what-locations-are-there) for more details about locations.
*/
readonly location: pulumi.Output<string>;
/**
* Name of the volume to create (must be unique per project).
*/
readonly name: pulumi.Output<string>;
/**
* Server to attach the Volume to, not allowed if location argument is passed.
*/
readonly serverId: pulumi.Output<number>;
/**
* Size of the volume (in GB).
*/
readonly size: pulumi.Output<number>;
/**
* Create a Volume resource with the given unique name, arguments, and options.
*
* @param name The _unique_ name of the resource.
* @param args The arguments to use to populate this resource's properties.
* @param opts A bag of options that control this resource's behavior.
*/
constructor(name: string, args: VolumeArgs, opts?: pulumi.CustomResourceOptions);
}
/**
* Input properties used for looking up and filtering Volume resources.
*/
export interface VolumeState {
/**
* Automount the volume upon attaching it (server_id must be provided).
*/
automount?: pulumi.Input<boolean | undefined>;
/**
* Enable or disable delete protection. See "Delete Protection" in the Provider Docs for details.
*
* **Note:** When you want to attach multiple volumes to a server, please use the `hcloud.VolumeAttachment` resource and the `location` argument instead of the `serverId` argument.
*/
deleteProtection?: pulumi.Input<boolean | undefined>;
/**
* Format volume after creation. `xfs` or `ext4`
*/
format?: pulumi.Input<string | undefined>;
/**
* User-defined labels (key-value pairs).
*/
labels?: pulumi.Input<{
[key: string]: pulumi.Input<string>;
} | undefined>;
/**
* (string) Device path on the file system for the Volume.
*/
linuxDevice?: pulumi.Input<string | undefined>;
/**
* The location name of the volume to create, not allowed if serverId argument is passed. See the [Hetzner Docs](https://docs.hetzner.com/cloud/general/locations/#what-locations-are-there) for more details about locations.
*/
location?: pulumi.Input<string | undefined>;
/**
* Name of the volume to create (must be unique per project).
*/
name?: pulumi.Input<string | undefined>;
/**
* Server to attach the Volume to, not allowed if location argument is passed.
*/
serverId?: pulumi.Input<number | undefined>;
/**
* Size of the volume (in GB).
*/
size?: pulumi.Input<number | undefined>;
}
/**
* The set of arguments for constructing a Volume resource.
*/
export interface VolumeArgs {
/**
* Automount the volume upon attaching it (server_id must be provided).
*/
automount?: pulumi.Input<boolean | undefined>;
/**
* Enable or disable delete protection. See "Delete Protection" in the Provider Docs for details.
*
* **Note:** When you want to attach multiple volumes to a server, please use the `hcloud.VolumeAttachment` resource and the `location` argument instead of the `serverId` argument.
*/
deleteProtection?: pulumi.Input<boolean | undefined>;
/**
* Format volume after creation. `xfs` or `ext4`
*/
format?: pulumi.Input<string | undefined>;
/**
* User-defined labels (key-value pairs).
*/
labels?: pulumi.Input<{
[key: string]: pulumi.Input<string>;
} | undefined>;
/**
* The location name of the volume to create, not allowed if serverId argument is passed. See the [Hetzner Docs](https://docs.hetzner.com/cloud/general/locations/#what-locations-are-there) for more details about locations.
*/
location?: pulumi.Input<string | undefined>;
/**
* Name of the volume to create (must be unique per project).
*/
name?: pulumi.Input<string | undefined>;
/**
* Server to attach the Volume to, not allowed if location argument is passed.
*/
serverId?: pulumi.Input<number | undefined>;
/**
* Size of the volume (in GB).
*/
size: pulumi.Input<number>;
}
//# sourceMappingURL=volume.d.ts.map