@pulumi/nomad
Version:
A Pulumi package for creating and managing nomad cloud resources.
331 lines (330 loc) • 12.7 kB
TypeScript
import * as pulumi from "@pulumi/pulumi";
import * as inputs from "./types/input";
import * as outputs from "./types/output";
/**
* ## Example Usage
*
* Registering a volume:
*
* ```typescript
* import * as pulumi from "@pulumi/pulumi";
* import * as nomad from "@pulumi/nomad";
*
* // It can sometimes be helpful to wait for a particular plugin to be available
* const ebs = nomad.getPlugin({
* pluginId: "aws-ebs0",
* waitForHealthy: true,
* });
* const mysqlVolume = new nomad.Volume("mysql_volume", {
* type: "csi",
* pluginId: "aws-ebs0",
* volumeId: "mysql_volume",
* name: "mysql_volume",
* externalId: hashistack.ebsTestVolumeId,
* capabilities: [{
* accessMode: "single-node-writer",
* attachmentMode: "file-system",
* }],
* mountOptions: {
* fsType: "ext4",
* },
* topologyRequest: {
* required: {
* topologies: [
* {
* segments: {
* rack: "R1",
* zone: "us-east-1a",
* },
* },
* {
* segments: {
* rack: "R2",
* },
* },
* ],
* },
* },
* }, {
* dependsOn: [ebs],
* });
* ```
*/
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;
/**
* `(string: <optional>)` - **Deprecated**. Use `capability` block instead. Defines whether a volume should be available concurrently. Possible values are:
* - `single-node-reader-only`
* - `single-node-writer`
* - `multi-node-reader-only`
* - `multi-node-single-writer`
* - `multi-node-multi-writer`
*
* @deprecated use capability instead
*/
readonly accessMode: pulumi.Output<string | undefined>;
/**
* `(string: <otional>)` - **Deprecated**. Use `capability` block instead. The storage API that will be used by the volume.
*
* @deprecated use capability instead
*/
readonly attachmentMode: pulumi.Output<string | undefined>;
/**
* `(``Capability``: <required>)` - Options for validating the capability of a volume.
*/
readonly capabilities: pulumi.Output<outputs.VolumeCapability[] | undefined>;
/**
* `(map[string]string: <optional>)` - An optional key-value map of strings passed directly to the CSI plugin to validate the volume.
*/
readonly context: pulumi.Output<{
[key: string]: string;
} | undefined>;
readonly controllerRequired: pulumi.Output<boolean>;
readonly controllersExpected: pulumi.Output<number>;
readonly controllersHealthy: pulumi.Output<number>;
/**
* `(boolean: true)` - If true, the volume will be deregistered on destroy.
*/
readonly deregisterOnDestroy: pulumi.Output<boolean | undefined>;
/**
* `(string: <required>)` - The ID of the physical volume from the storage provider.
*/
readonly externalId: pulumi.Output<string>;
/**
* `(block: <optional>)` Options for mounting `block-device` volumes without a pre-formatted file system.
*/
readonly mountOptions: pulumi.Output<outputs.VolumeMountOptions | undefined>;
/**
* `(string: <required>)` - The display name for the volume.
*/
readonly name: pulumi.Output<string>;
/**
* `(string: "default")` - The namespace in which to register the volume.
*/
readonly namespace: pulumi.Output<string | undefined>;
readonly nodesExpected: pulumi.Output<number>;
readonly nodesHealthy: pulumi.Output<number>;
/**
* `(map[string]string: <optional>)` - An optional key-value map of strings passed directly to the CSI plugin to configure the volume.
*/
readonly parameters: pulumi.Output<{
[key: string]: string;
} | undefined>;
/**
* `(string: <required>)` - The ID of the Nomad plugin for registering this volume.
*/
readonly pluginId: pulumi.Output<string>;
readonly pluginProvider: pulumi.Output<string>;
readonly pluginProviderVersion: pulumi.Output<string>;
readonly schedulable: pulumi.Output<boolean>;
/**
* `(map[string]string: <optional>)` - An optional key-value map of strings used as credentials for publishing and unpublishing volumes.
*/
readonly secrets: pulumi.Output<{
[key: string]: string;
} | undefined>;
readonly topologies: pulumi.Output<outputs.VolumeTopology[]>;
/**
* `(``TopologyRequest``: <optional>)` - Specify locations (region, zone, rack, etc.) where the provisioned volume is accessible from.
*/
readonly topologyRequest: pulumi.Output<outputs.VolumeTopologyRequest | undefined>;
/**
* `(string: <required>)` - The type of the volume. Currently, only `csi` is supported.
*/
readonly type: pulumi.Output<string | undefined>;
/**
* `(string: <required>)` - The unique ID of the volume.
*/
readonly volumeId: pulumi.Output<string>;
/**
* 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 {
/**
* `(string: <optional>)` - **Deprecated**. Use `capability` block instead. Defines whether a volume should be available concurrently. Possible values are:
* - `single-node-reader-only`
* - `single-node-writer`
* - `multi-node-reader-only`
* - `multi-node-single-writer`
* - `multi-node-multi-writer`
*
* @deprecated use capability instead
*/
accessMode?: pulumi.Input<string>;
/**
* `(string: <otional>)` - **Deprecated**. Use `capability` block instead. The storage API that will be used by the volume.
*
* @deprecated use capability instead
*/
attachmentMode?: pulumi.Input<string>;
/**
* `(``Capability``: <required>)` - Options for validating the capability of a volume.
*/
capabilities?: pulumi.Input<pulumi.Input<inputs.VolumeCapability>[]>;
/**
* `(map[string]string: <optional>)` - An optional key-value map of strings passed directly to the CSI plugin to validate the volume.
*/
context?: pulumi.Input<{
[key: string]: pulumi.Input<string>;
}>;
controllerRequired?: pulumi.Input<boolean>;
controllersExpected?: pulumi.Input<number>;
controllersHealthy?: pulumi.Input<number>;
/**
* `(boolean: true)` - If true, the volume will be deregistered on destroy.
*/
deregisterOnDestroy?: pulumi.Input<boolean>;
/**
* `(string: <required>)` - The ID of the physical volume from the storage provider.
*/
externalId?: pulumi.Input<string>;
/**
* `(block: <optional>)` Options for mounting `block-device` volumes without a pre-formatted file system.
*/
mountOptions?: pulumi.Input<inputs.VolumeMountOptions>;
/**
* `(string: <required>)` - The display name for the volume.
*/
name?: pulumi.Input<string>;
/**
* `(string: "default")` - The namespace in which to register the volume.
*/
namespace?: pulumi.Input<string>;
nodesExpected?: pulumi.Input<number>;
nodesHealthy?: pulumi.Input<number>;
/**
* `(map[string]string: <optional>)` - An optional key-value map of strings passed directly to the CSI plugin to configure the volume.
*/
parameters?: pulumi.Input<{
[key: string]: pulumi.Input<string>;
}>;
/**
* `(string: <required>)` - The ID of the Nomad plugin for registering this volume.
*/
pluginId?: pulumi.Input<string>;
pluginProvider?: pulumi.Input<string>;
pluginProviderVersion?: pulumi.Input<string>;
schedulable?: pulumi.Input<boolean>;
/**
* `(map[string]string: <optional>)` - An optional key-value map of strings used as credentials for publishing and unpublishing volumes.
*/
secrets?: pulumi.Input<{
[key: string]: pulumi.Input<string>;
}>;
topologies?: pulumi.Input<pulumi.Input<inputs.VolumeTopology>[]>;
/**
* `(``TopologyRequest``: <optional>)` - Specify locations (region, zone, rack, etc.) where the provisioned volume is accessible from.
*/
topologyRequest?: pulumi.Input<inputs.VolumeTopologyRequest>;
/**
* `(string: <required>)` - The type of the volume. Currently, only `csi` is supported.
*/
type?: pulumi.Input<string>;
/**
* `(string: <required>)` - The unique ID of the volume.
*/
volumeId?: pulumi.Input<string>;
}
/**
* The set of arguments for constructing a Volume resource.
*/
export interface VolumeArgs {
/**
* `(string: <optional>)` - **Deprecated**. Use `capability` block instead. Defines whether a volume should be available concurrently. Possible values are:
* - `single-node-reader-only`
* - `single-node-writer`
* - `multi-node-reader-only`
* - `multi-node-single-writer`
* - `multi-node-multi-writer`
*
* @deprecated use capability instead
*/
accessMode?: pulumi.Input<string>;
/**
* `(string: <otional>)` - **Deprecated**. Use `capability` block instead. The storage API that will be used by the volume.
*
* @deprecated use capability instead
*/
attachmentMode?: pulumi.Input<string>;
/**
* `(``Capability``: <required>)` - Options for validating the capability of a volume.
*/
capabilities?: pulumi.Input<pulumi.Input<inputs.VolumeCapability>[]>;
/**
* `(map[string]string: <optional>)` - An optional key-value map of strings passed directly to the CSI plugin to validate the volume.
*/
context?: pulumi.Input<{
[key: string]: pulumi.Input<string>;
}>;
/**
* `(boolean: true)` - If true, the volume will be deregistered on destroy.
*/
deregisterOnDestroy?: pulumi.Input<boolean>;
/**
* `(string: <required>)` - The ID of the physical volume from the storage provider.
*/
externalId: pulumi.Input<string>;
/**
* `(block: <optional>)` Options for mounting `block-device` volumes without a pre-formatted file system.
*/
mountOptions?: pulumi.Input<inputs.VolumeMountOptions>;
/**
* `(string: <required>)` - The display name for the volume.
*/
name?: pulumi.Input<string>;
/**
* `(string: "default")` - The namespace in which to register the volume.
*/
namespace?: pulumi.Input<string>;
/**
* `(map[string]string: <optional>)` - An optional key-value map of strings passed directly to the CSI plugin to configure the volume.
*/
parameters?: pulumi.Input<{
[key: string]: pulumi.Input<string>;
}>;
/**
* `(string: <required>)` - The ID of the Nomad plugin for registering this volume.
*/
pluginId: pulumi.Input<string>;
/**
* `(map[string]string: <optional>)` - An optional key-value map of strings used as credentials for publishing and unpublishing volumes.
*/
secrets?: pulumi.Input<{
[key: string]: pulumi.Input<string>;
}>;
/**
* `(``TopologyRequest``: <optional>)` - Specify locations (region, zone, rack, etc.) where the provisioned volume is accessible from.
*/
topologyRequest?: pulumi.Input<inputs.VolumeTopologyRequest>;
/**
* `(string: <required>)` - The type of the volume. Currently, only `csi` is supported.
*/
type?: pulumi.Input<string>;
/**
* `(string: <required>)` - The unique ID of the volume.
*/
volumeId: pulumi.Input<string>;
}