@pulumi/nomad
Version:
A Pulumi package for creating and managing nomad cloud resources.
326 lines (325 loc) • 14.1 kB
TypeScript
import * as pulumi from "@pulumi/pulumi";
import * as inputs from "./types/input";
import * as outputs from "./types/output";
/**
* layout: "nomad"
* page_title: "Nomad: nomad.DynamicHostVolume"
* sidebar_current: "docs-nomad-resource-dynamic-host-volume"
* description: |-
* Manages the lifecycle of creating and deleting dynamic host volumes.
* ---
*
* Creates and registers a dynamic host volume in Nomad. Note that Nomad supports
* two workflows for dynamic host volumes: create and register. Both resources
* result in the same data source with the same outputs.
*
* > **Warning:** Destroying this resource **will result in data loss**. Use the
* [`preventDestroy`][tfDocsPreventDestroy] directive to avoid accidental
* deletions.
*
* ## Example Usage
*
* Creating a dynamic host volume:
*
* ```typescript
* import * as pulumi from "@pulumi/pulumi";
* import * as nomad from "@pulumi/nomad";
*
* const example = new nomad.DynamicHostVolume("example", {
* name: "example",
* namespace: "prod",
* pluginId: "mkdir",
* capacityMax: "12 GiB",
* capacityMin: "1.0 GiB",
* capabilities: [{
* accessMode: "single-node-writer",
* attachmentMode: "file-system",
* }],
* constraints: [{
* attribute: `${attr.kernel.name}`,
* value: "linux",
* }],
* parameters: {
* some_key: "some_value",
* },
* });
* ```
*/
export declare class DynamicHostVolume extends pulumi.CustomResource {
/**
* Get an existing DynamicHostVolume 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?: DynamicHostVolumeState, opts?: pulumi.CustomResourceOptions): DynamicHostVolume;
/**
* Returns true if the given object is an instance of DynamicHostVolume. 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 DynamicHostVolume;
/**
* `(block: <optional>)` - Option for validating the capability of a
* volume. Each capability block has the following attributes:
*/
readonly capabilities: pulumi.Output<outputs.DynamicHostVolumeCapability[]>;
/**
* Provisioned capacity
*/
readonly capacity: pulumi.Output<string>;
readonly capacityBytes: pulumi.Output<number>;
/**
* `(string: <optional>)` - Option for requesting a maximum
* capacity, in bytes. The capacity of a volume may be the physical size of a
* disk, or a quota, depending on the plugin. The specific size of the resulting
* volume is somewhere between `capacityMin` and `capacityMax`; the exact
* behavior is up to the plugin. If you want to specify an exact size, set
* `capacityMin` and `capacityMax` to the same value. Accepts human-friendly
* suffixes such as `"100GiB"`. Plugins that cannot restrict the size of volumes
* may ignore this field.
*/
readonly capacityMax: pulumi.Output<string | undefined>;
readonly capacityMaxBytes: pulumi.Output<number>;
/**
* `(string: <optional>)` - Option for requesting a minimum
* capacity, in bytes. The capacity of a volume may be the physical size of a
* disk, or a quota, depending on the plugin. The specific size of the resulting
* volume is somewhere between `capacityMin` and `capacityMax`; the exact
* behavior is up to the plugin. If you want to specify an exact size, set
* `capacityMin` and `capacityMax` to the same value. Accepts human-friendly
* suffixes such as `"100GiB"`. Plugins that cannot restrict the size of volumes
* may ignore this field.
*/
readonly capacityMin: pulumi.Output<string | undefined>;
readonly capacityMinBytes: pulumi.Output<number>;
/**
* `(block: <optional>)` - A restriction on the eligible nodes where
* a volume can be created, similar to the [`constraint`][] block on a Nomad job
* specification.. You can provide multiple `constraint` blocks to add more
* constraints. Each constraint block has the following attributes.
*/
readonly constraints: pulumi.Output<outputs.DynamicHostVolumeConstraint[] | undefined>;
/**
* Host path
*/
readonly hostPath: pulumi.Output<string>;
/**
* `(string: <required>)` - The name of the volume, which is used as the
* [`volume.source`][volumeSource] field in job specifications that claim this
* volume. Host volume names must be unique per node. Names are visible to any
* user with `node:read` ACL, even across namespaces, so they should not be
* treated as sensitive values.
*/
readonly name: pulumi.Output<string>;
/**
* `(string: <optional>)` - The namespace of the volume. This field
* overrides the namespace provided by the `-namespace` flag or `NOMAD_NAMESPACE`
* environment variable. Defaults to `"default"` if unset.
*/
readonly namespace: pulumi.Output<string | undefined>;
/**
* `(string: <optional>)` - A specific node where you would like the
* volume to be created.
*/
readonly nodeId: pulumi.Output<string>;
/**
* `(string: <optional>)` - A specific node pool where you would like
* the volume to be created. If you also provide `nodeId`, the node must be in the
* provided `nodePool`.
*/
readonly nodePool: pulumi.Output<string>;
/**
* `(map<string|string>: <optional>)` - A key-value map of strings
* passed directly to the plugin to configure the volume. The details of these
* parameters are specific to the plugin.
*/
readonly parameters: pulumi.Output<{
[key: string]: string;
} | undefined>;
/**
* Plugin ID
*/
readonly pluginId: pulumi.Output<string>;
/**
* State
*/
readonly state: pulumi.Output<string>;
/**
* Create a DynamicHostVolume 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: DynamicHostVolumeArgs, opts?: pulumi.CustomResourceOptions);
}
/**
* Input properties used for looking up and filtering DynamicHostVolume resources.
*/
export interface DynamicHostVolumeState {
/**
* `(block: <optional>)` - Option for validating the capability of a
* volume. Each capability block has the following attributes:
*/
capabilities?: pulumi.Input<pulumi.Input<inputs.DynamicHostVolumeCapability>[]>;
/**
* Provisioned capacity
*/
capacity?: pulumi.Input<string>;
capacityBytes?: pulumi.Input<number>;
/**
* `(string: <optional>)` - Option for requesting a maximum
* capacity, in bytes. The capacity of a volume may be the physical size of a
* disk, or a quota, depending on the plugin. The specific size of the resulting
* volume is somewhere between `capacityMin` and `capacityMax`; the exact
* behavior is up to the plugin. If you want to specify an exact size, set
* `capacityMin` and `capacityMax` to the same value. Accepts human-friendly
* suffixes such as `"100GiB"`. Plugins that cannot restrict the size of volumes
* may ignore this field.
*/
capacityMax?: pulumi.Input<string>;
capacityMaxBytes?: pulumi.Input<number>;
/**
* `(string: <optional>)` - Option for requesting a minimum
* capacity, in bytes. The capacity of a volume may be the physical size of a
* disk, or a quota, depending on the plugin. The specific size of the resulting
* volume is somewhere between `capacityMin` and `capacityMax`; the exact
* behavior is up to the plugin. If you want to specify an exact size, set
* `capacityMin` and `capacityMax` to the same value. Accepts human-friendly
* suffixes such as `"100GiB"`. Plugins that cannot restrict the size of volumes
* may ignore this field.
*/
capacityMin?: pulumi.Input<string>;
capacityMinBytes?: pulumi.Input<number>;
/**
* `(block: <optional>)` - A restriction on the eligible nodes where
* a volume can be created, similar to the [`constraint`][] block on a Nomad job
* specification.. You can provide multiple `constraint` blocks to add more
* constraints. Each constraint block has the following attributes.
*/
constraints?: pulumi.Input<pulumi.Input<inputs.DynamicHostVolumeConstraint>[]>;
/**
* Host path
*/
hostPath?: pulumi.Input<string>;
/**
* `(string: <required>)` - The name of the volume, which is used as the
* [`volume.source`][volumeSource] field in job specifications that claim this
* volume. Host volume names must be unique per node. Names are visible to any
* user with `node:read` ACL, even across namespaces, so they should not be
* treated as sensitive values.
*/
name?: pulumi.Input<string>;
/**
* `(string: <optional>)` - The namespace of the volume. This field
* overrides the namespace provided by the `-namespace` flag or `NOMAD_NAMESPACE`
* environment variable. Defaults to `"default"` if unset.
*/
namespace?: pulumi.Input<string>;
/**
* `(string: <optional>)` - A specific node where you would like the
* volume to be created.
*/
nodeId?: pulumi.Input<string>;
/**
* `(string: <optional>)` - A specific node pool where you would like
* the volume to be created. If you also provide `nodeId`, the node must be in the
* provided `nodePool`.
*/
nodePool?: pulumi.Input<string>;
/**
* `(map<string|string>: <optional>)` - A key-value map of strings
* passed directly to the plugin to configure the volume. The details of these
* parameters are specific to the plugin.
*/
parameters?: pulumi.Input<{
[key: string]: pulumi.Input<string>;
}>;
/**
* Plugin ID
*/
pluginId?: pulumi.Input<string>;
/**
* State
*/
state?: pulumi.Input<string>;
}
/**
* The set of arguments for constructing a DynamicHostVolume resource.
*/
export interface DynamicHostVolumeArgs {
/**
* `(block: <optional>)` - Option for validating the capability of a
* volume. Each capability block has the following attributes:
*/
capabilities: pulumi.Input<pulumi.Input<inputs.DynamicHostVolumeCapability>[]>;
/**
* `(string: <optional>)` - Option for requesting a maximum
* capacity, in bytes. The capacity of a volume may be the physical size of a
* disk, or a quota, depending on the plugin. The specific size of the resulting
* volume is somewhere between `capacityMin` and `capacityMax`; the exact
* behavior is up to the plugin. If you want to specify an exact size, set
* `capacityMin` and `capacityMax` to the same value. Accepts human-friendly
* suffixes such as `"100GiB"`. Plugins that cannot restrict the size of volumes
* may ignore this field.
*/
capacityMax?: pulumi.Input<string>;
/**
* `(string: <optional>)` - Option for requesting a minimum
* capacity, in bytes. The capacity of a volume may be the physical size of a
* disk, or a quota, depending on the plugin. The specific size of the resulting
* volume is somewhere between `capacityMin` and `capacityMax`; the exact
* behavior is up to the plugin. If you want to specify an exact size, set
* `capacityMin` and `capacityMax` to the same value. Accepts human-friendly
* suffixes such as `"100GiB"`. Plugins that cannot restrict the size of volumes
* may ignore this field.
*/
capacityMin?: pulumi.Input<string>;
/**
* `(block: <optional>)` - A restriction on the eligible nodes where
* a volume can be created, similar to the [`constraint`][] block on a Nomad job
* specification.. You can provide multiple `constraint` blocks to add more
* constraints. Each constraint block has the following attributes.
*/
constraints?: pulumi.Input<pulumi.Input<inputs.DynamicHostVolumeConstraint>[]>;
/**
* `(string: <required>)` - The name of the volume, which is used as the
* [`volume.source`][volumeSource] field in job specifications that claim this
* volume. Host volume names must be unique per node. Names are visible to any
* user with `node:read` ACL, even across namespaces, so they should not be
* treated as sensitive values.
*/
name?: pulumi.Input<string>;
/**
* `(string: <optional>)` - The namespace of the volume. This field
* overrides the namespace provided by the `-namespace` flag or `NOMAD_NAMESPACE`
* environment variable. Defaults to `"default"` if unset.
*/
namespace?: pulumi.Input<string>;
/**
* `(string: <optional>)` - A specific node where you would like the
* volume to be created.
*/
nodeId?: pulumi.Input<string>;
/**
* `(string: <optional>)` - A specific node pool where you would like
* the volume to be created. If you also provide `nodeId`, the node must be in the
* provided `nodePool`.
*/
nodePool?: pulumi.Input<string>;
/**
* `(map<string|string>: <optional>)` - A key-value map of strings
* passed directly to the plugin to configure the volume. The details of these
* parameters are specific to the plugin.
*/
parameters?: pulumi.Input<{
[key: string]: pulumi.Input<string>;
}>;
/**
* Plugin ID
*/
pluginId: pulumi.Input<string>;
}