1. Packages
  2. Nomad Provider
  3. API Docs
  4. DynamicHostVolume
Nomad v2.5.0 published on Thursday, Apr 17, 2025 by Pulumi

nomad.DynamicHostVolume

Explore with Pulumi AI

nomad logo
Nomad v2.5.0 published on Thursday, Apr 17, 2025 by Pulumi

    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 [prevent_destroy][tf_docs_prevent_destroy] directive to avoid accidental deletions.

    Example Usage

    Creating a dynamic host volume:

    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",
        },
    });
    
    import pulumi
    import pulumi_nomad as nomad
    
    example = nomad.DynamicHostVolume("example",
        name="example",
        namespace="prod",
        plugin_id="mkdir",
        capacity_max="12 GiB",
        capacity_min="1.0 GiB",
        capabilities=[{
            "access_mode": "single-node-writer",
            "attachment_mode": "file-system",
        }],
        constraints=[{
            "attribute": "${attr.kernel.name}",
            "value": "linux",
        }],
        parameters={
            "some_key": "some_value",
        })
    
    package main
    
    import (
    	"fmt"
    
    	"github.com/pulumi/pulumi-nomad/sdk/v2/go/nomad"
    	"github.com/pulumi/pulumi/sdk/v3/go/pulumi"
    )
    
    func main() {
    	pulumi.Run(func(ctx *pulumi.Context) error {
    		_, err := nomad.NewDynamicHostVolume(ctx, "example", &nomad.DynamicHostVolumeArgs{
    			Name:        pulumi.String("example"),
    			Namespace:   pulumi.String("prod"),
    			PluginId:    pulumi.String("mkdir"),
    			CapacityMax: pulumi.String("12 GiB"),
    			CapacityMin: pulumi.String("1.0 GiB"),
    			Capabilities: nomad.DynamicHostVolumeCapabilityArray{
    				&nomad.DynamicHostVolumeCapabilityArgs{
    					AccessMode:     pulumi.String("single-node-writer"),
    					AttachmentMode: pulumi.String("file-system"),
    				},
    			},
    			Constraints: nomad.DynamicHostVolumeConstraintArray{
    				&nomad.DynamicHostVolumeConstraintArgs{
    					Attribute: pulumi.Sprintf("${attr.kernel.name}"),
    					Value:     pulumi.String("linux"),
    				},
    			},
    			Parameters: pulumi.StringMap{
    				"some_key": pulumi.String("some_value"),
    			},
    		})
    		if err != nil {
    			return err
    		}
    		return nil
    	})
    }
    
    using System.Collections.Generic;
    using System.Linq;
    using Pulumi;
    using Nomad = Pulumi.Nomad;
    
    return await Deployment.RunAsync(() => 
    {
        var example = new Nomad.DynamicHostVolume("example", new()
        {
            Name = "example",
            Namespace = "prod",
            PluginId = "mkdir",
            CapacityMax = "12 GiB",
            CapacityMin = "1.0 GiB",
            Capabilities = new[]
            {
                new Nomad.Inputs.DynamicHostVolumeCapabilityArgs
                {
                    AccessMode = "single-node-writer",
                    AttachmentMode = "file-system",
                },
            },
            Constraints = new[]
            {
                new Nomad.Inputs.DynamicHostVolumeConstraintArgs
                {
                    Attribute = "${attr.kernel.name}",
                    Value = "linux",
                },
            },
            Parameters = 
            {
                { "some_key", "some_value" },
            },
        });
    
    });
    
    package generated_program;
    
    import com.pulumi.Context;
    import com.pulumi.Pulumi;
    import com.pulumi.core.Output;
    import com.pulumi.nomad.DynamicHostVolume;
    import com.pulumi.nomad.DynamicHostVolumeArgs;
    import com.pulumi.nomad.inputs.DynamicHostVolumeCapabilityArgs;
    import com.pulumi.nomad.inputs.DynamicHostVolumeConstraintArgs;
    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) {
            var example = new DynamicHostVolume("example", DynamicHostVolumeArgs.builder()
                .name("example")
                .namespace("prod")
                .pluginId("mkdir")
                .capacityMax("12 GiB")
                .capacityMin("1.0 GiB")
                .capabilities(DynamicHostVolumeCapabilityArgs.builder()
                    .accessMode("single-node-writer")
                    .attachmentMode("file-system")
                    .build())
                .constraints(DynamicHostVolumeConstraintArgs.builder()
                    .attribute("${attr.kernel.name}")
                    .value("linux")
                    .build())
                .parameters(Map.of("some_key", "some_value"))
                .build());
    
        }
    }
    
    resources:
      example:
        type: nomad:DynamicHostVolume
        properties:
          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
    

    Create DynamicHostVolume Resource

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

    Constructor syntax

    new DynamicHostVolume(name: string, args: DynamicHostVolumeArgs, opts?: CustomResourceOptions);
    @overload
    def DynamicHostVolume(resource_name: str,
                          args: DynamicHostVolumeArgs,
                          opts: Optional[ResourceOptions] = None)
    
    @overload
    def DynamicHostVolume(resource_name: str,
                          opts: Optional[ResourceOptions] = None,
                          capabilities: Optional[Sequence[DynamicHostVolumeCapabilityArgs]] = None,
                          plugin_id: Optional[str] = None,
                          capacity_max: Optional[str] = None,
                          capacity_min: Optional[str] = None,
                          constraints: Optional[Sequence[DynamicHostVolumeConstraintArgs]] = None,
                          name: Optional[str] = None,
                          namespace: Optional[str] = None,
                          node_id: Optional[str] = None,
                          node_pool: Optional[str] = None,
                          parameters: Optional[Mapping[str, str]] = None)
    func NewDynamicHostVolume(ctx *Context, name string, args DynamicHostVolumeArgs, opts ...ResourceOption) (*DynamicHostVolume, error)
    public DynamicHostVolume(string name, DynamicHostVolumeArgs args, CustomResourceOptions? opts = null)
    public DynamicHostVolume(String name, DynamicHostVolumeArgs args)
    public DynamicHostVolume(String name, DynamicHostVolumeArgs args, CustomResourceOptions options)
    
    type: nomad:DynamicHostVolume
    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 DynamicHostVolumeArgs
    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 DynamicHostVolumeArgs
    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 DynamicHostVolumeArgs
    The arguments to resource properties.
    opts ResourceOption
    Bag of options to control resource's behavior.
    name string
    The unique name of the resource.
    args DynamicHostVolumeArgs
    The arguments to resource properties.
    opts CustomResourceOptions
    Bag of options to control resource's behavior.
    name String
    The unique name of the resource.
    args DynamicHostVolumeArgs
    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 dynamicHostVolumeResource = new Nomad.DynamicHostVolume("dynamicHostVolumeResource", new()
    {
        Capabilities = new[]
        {
            new Nomad.Inputs.DynamicHostVolumeCapabilityArgs
            {
                AccessMode = "string",
                AttachmentMode = "string",
            },
        },
        PluginId = "string",
        CapacityMax = "string",
        CapacityMin = "string",
        Constraints = new[]
        {
            new Nomad.Inputs.DynamicHostVolumeConstraintArgs
            {
                Attribute = "string",
                Operator = "string",
                Value = "string",
            },
        },
        Name = "string",
        Namespace = "string",
        NodeId = "string",
        NodePool = "string",
        Parameters = 
        {
            { "string", "string" },
        },
    });
    
    example, err := nomad.NewDynamicHostVolume(ctx, "dynamicHostVolumeResource", &nomad.DynamicHostVolumeArgs{
    	Capabilities: nomad.DynamicHostVolumeCapabilityArray{
    		&nomad.DynamicHostVolumeCapabilityArgs{
    			AccessMode:     pulumi.String("string"),
    			AttachmentMode: pulumi.String("string"),
    		},
    	},
    	PluginId:    pulumi.String("string"),
    	CapacityMax: pulumi.String("string"),
    	CapacityMin: pulumi.String("string"),
    	Constraints: nomad.DynamicHostVolumeConstraintArray{
    		&nomad.DynamicHostVolumeConstraintArgs{
    			Attribute: pulumi.String("string"),
    			Operator:  pulumi.String("string"),
    			Value:     pulumi.String("string"),
    		},
    	},
    	Name:      pulumi.String("string"),
    	Namespace: pulumi.String("string"),
    	NodeId:    pulumi.String("string"),
    	NodePool:  pulumi.String("string"),
    	Parameters: pulumi.StringMap{
    		"string": pulumi.String("string"),
    	},
    })
    
    var dynamicHostVolumeResource = new DynamicHostVolume("dynamicHostVolumeResource", DynamicHostVolumeArgs.builder()
        .capabilities(DynamicHostVolumeCapabilityArgs.builder()
            .accessMode("string")
            .attachmentMode("string")
            .build())
        .pluginId("string")
        .capacityMax("string")
        .capacityMin("string")
        .constraints(DynamicHostVolumeConstraintArgs.builder()
            .attribute("string")
            .operator("string")
            .value("string")
            .build())
        .name("string")
        .namespace("string")
        .nodeId("string")
        .nodePool("string")
        .parameters(Map.of("string", "string"))
        .build());
    
    dynamic_host_volume_resource = nomad.DynamicHostVolume("dynamicHostVolumeResource",
        capabilities=[{
            "access_mode": "string",
            "attachment_mode": "string",
        }],
        plugin_id="string",
        capacity_max="string",
        capacity_min="string",
        constraints=[{
            "attribute": "string",
            "operator": "string",
            "value": "string",
        }],
        name="string",
        namespace="string",
        node_id="string",
        node_pool="string",
        parameters={
            "string": "string",
        })
    
    const dynamicHostVolumeResource = new nomad.DynamicHostVolume("dynamicHostVolumeResource", {
        capabilities: [{
            accessMode: "string",
            attachmentMode: "string",
        }],
        pluginId: "string",
        capacityMax: "string",
        capacityMin: "string",
        constraints: [{
            attribute: "string",
            operator: "string",
            value: "string",
        }],
        name: "string",
        namespace: "string",
        nodeId: "string",
        nodePool: "string",
        parameters: {
            string: "string",
        },
    });
    
    type: nomad:DynamicHostVolume
    properties:
        capabilities:
            - accessMode: string
              attachmentMode: string
        capacityMax: string
        capacityMin: string
        constraints:
            - attribute: string
              operator: string
              value: string
        name: string
        namespace: string
        nodeId: string
        nodePool: string
        parameters:
            string: string
        pluginId: string
    

    DynamicHostVolume 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 DynamicHostVolume resource accepts the following input properties:

    Capabilities List<DynamicHostVolumeCapability>
    (block: <optional>) - Option for validating the capability of a volume. Each capability block has the following attributes:
    PluginId string
    Plugin ID
    CapacityMax string
    (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 capacity_min and capacity_max; the exact behavior is up to the plugin. If you want to specify an exact size, set capacity_min and capacity_max to the same value. Accepts human-friendly suffixes such as "100GiB". Plugins that cannot restrict the size of volumes may ignore this field.
    CapacityMin 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 capacity_min and capacity_max; the exact behavior is up to the plugin. If you want to specify an exact size, set capacity_min and capacity_max to the same value. Accepts human-friendly suffixes such as "100GiB". Plugins that cannot restrict the size of volumes may ignore this field.
    Constraints List<DynamicHostVolumeConstraint>
    (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.
    Name string
    (string: <required>) - The name of the volume, which is used as the [volume.source][volume_source] 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.
    Namespace 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.
    NodeId string
    (string: <optional>) - A specific node where you would like the volume to be created.
    NodePool string
    (string: <optional>) - A specific node pool where you would like the volume to be created. If you also provide node_id, the node must be in the provided node_pool.
    Parameters Dictionary<string, 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.
    Capabilities []DynamicHostVolumeCapabilityArgs
    (block: <optional>) - Option for validating the capability of a volume. Each capability block has the following attributes:
    PluginId string
    Plugin ID
    CapacityMax string
    (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 capacity_min and capacity_max; the exact behavior is up to the plugin. If you want to specify an exact size, set capacity_min and capacity_max to the same value. Accepts human-friendly suffixes such as "100GiB". Plugins that cannot restrict the size of volumes may ignore this field.
    CapacityMin 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 capacity_min and capacity_max; the exact behavior is up to the plugin. If you want to specify an exact size, set capacity_min and capacity_max to the same value. Accepts human-friendly suffixes such as "100GiB". Plugins that cannot restrict the size of volumes may ignore this field.
    Constraints []DynamicHostVolumeConstraintArgs
    (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.
    Name string
    (string: <required>) - The name of the volume, which is used as the [volume.source][volume_source] 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.
    Namespace 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.
    NodeId string
    (string: <optional>) - A specific node where you would like the volume to be created.
    NodePool string
    (string: <optional>) - A specific node pool where you would like the volume to be created. If you also provide node_id, the node must be in the provided node_pool.
    Parameters map[string]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.
    capabilities List<DynamicHostVolumeCapability>
    (block: <optional>) - Option for validating the capability of a volume. Each capability block has the following attributes:
    pluginId String
    Plugin ID
    capacityMax String
    (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 capacity_min and capacity_max; the exact behavior is up to the plugin. If you want to specify an exact size, set capacity_min and capacity_max to the same value. Accepts human-friendly suffixes such as "100GiB". Plugins that cannot restrict the size of volumes may ignore this field.
    capacityMin 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 capacity_min and capacity_max; the exact behavior is up to the plugin. If you want to specify an exact size, set capacity_min and capacity_max to the same value. Accepts human-friendly suffixes such as "100GiB". Plugins that cannot restrict the size of volumes may ignore this field.
    constraints List<DynamicHostVolumeConstraint>
    (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.
    name String
    (string: <required>) - The name of the volume, which is used as the [volume.source][volume_source] 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.
    namespace 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.
    nodeId String
    (string: <optional>) - A specific node where you would like the volume to be created.
    nodePool String
    (string: <optional>) - A specific node pool where you would like the volume to be created. If you also provide node_id, the node must be in the provided node_pool.
    parameters Map<String,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.
    capabilities DynamicHostVolumeCapability[]
    (block: <optional>) - Option for validating the capability of a volume. Each capability block has the following attributes:
    pluginId string
    Plugin ID
    capacityMax string
    (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 capacity_min and capacity_max; the exact behavior is up to the plugin. If you want to specify an exact size, set capacity_min and capacity_max to the same value. Accepts human-friendly suffixes such as "100GiB". Plugins that cannot restrict the size of volumes may ignore this field.
    capacityMin 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 capacity_min and capacity_max; the exact behavior is up to the plugin. If you want to specify an exact size, set capacity_min and capacity_max to the same value. Accepts human-friendly suffixes such as "100GiB". Plugins that cannot restrict the size of volumes may ignore this field.
    constraints DynamicHostVolumeConstraint[]
    (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.
    name string
    (string: <required>) - The name of the volume, which is used as the [volume.source][volume_source] 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.
    namespace 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.
    nodeId string
    (string: <optional>) - A specific node where you would like the volume to be created.
    nodePool string
    (string: <optional>) - A specific node pool where you would like the volume to be created. If you also provide node_id, the node must be in the provided node_pool.
    parameters {[key: string]: 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.
    capabilities Sequence[DynamicHostVolumeCapabilityArgs]
    (block: <optional>) - Option for validating the capability of a volume. Each capability block has the following attributes:
    plugin_id str
    Plugin ID
    capacity_max str
    (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 capacity_min and capacity_max; the exact behavior is up to the plugin. If you want to specify an exact size, set capacity_min and capacity_max to the same value. Accepts human-friendly suffixes such as "100GiB". Plugins that cannot restrict the size of volumes may ignore this field.
    capacity_min str
    (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 capacity_min and capacity_max; the exact behavior is up to the plugin. If you want to specify an exact size, set capacity_min and capacity_max to the same value. Accepts human-friendly suffixes such as "100GiB". Plugins that cannot restrict the size of volumes may ignore this field.
    constraints Sequence[DynamicHostVolumeConstraintArgs]
    (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.
    name str
    (string: <required>) - The name of the volume, which is used as the [volume.source][volume_source] 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.
    namespace str
    (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.
    node_id str
    (string: <optional>) - A specific node where you would like the volume to be created.
    node_pool str
    (string: <optional>) - A specific node pool where you would like the volume to be created. If you also provide node_id, the node must be in the provided node_pool.
    parameters Mapping[str, str]
    (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.
    capabilities List<Property Map>
    (block: <optional>) - Option for validating the capability of a volume. Each capability block has the following attributes:
    pluginId String
    Plugin ID
    capacityMax String
    (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 capacity_min and capacity_max; the exact behavior is up to the plugin. If you want to specify an exact size, set capacity_min and capacity_max to the same value. Accepts human-friendly suffixes such as "100GiB". Plugins that cannot restrict the size of volumes may ignore this field.
    capacityMin 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 capacity_min and capacity_max; the exact behavior is up to the plugin. If you want to specify an exact size, set capacity_min and capacity_max to the same value. Accepts human-friendly suffixes such as "100GiB". Plugins that cannot restrict the size of volumes may ignore this field.
    constraints List<Property Map>
    (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.
    name String
    (string: <required>) - The name of the volume, which is used as the [volume.source][volume_source] 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.
    namespace 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.
    nodeId String
    (string: <optional>) - A specific node where you would like the volume to be created.
    nodePool String
    (string: <optional>) - A specific node pool where you would like the volume to be created. If you also provide node_id, the node must be in the provided node_pool.
    parameters Map<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.

    Outputs

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

    Capacity string
    Provisioned capacity
    CapacityBytes int
    CapacityMaxBytes int
    CapacityMinBytes int
    HostPath string
    Host path
    Id string
    The provider-assigned unique ID for this managed resource.
    State string
    State
    Capacity string
    Provisioned capacity
    CapacityBytes int
    CapacityMaxBytes int
    CapacityMinBytes int
    HostPath string
    Host path
    Id string
    The provider-assigned unique ID for this managed resource.
    State string
    State
    capacity String
    Provisioned capacity
    capacityBytes Integer
    capacityMaxBytes Integer
    capacityMinBytes Integer
    hostPath String
    Host path
    id String
    The provider-assigned unique ID for this managed resource.
    state String
    State
    capacity string
    Provisioned capacity
    capacityBytes number
    capacityMaxBytes number
    capacityMinBytes number
    hostPath string
    Host path
    id string
    The provider-assigned unique ID for this managed resource.
    state string
    State
    capacity str
    Provisioned capacity
    capacity_bytes int
    capacity_max_bytes int
    capacity_min_bytes int
    host_path str
    Host path
    id str
    The provider-assigned unique ID for this managed resource.
    state str
    State
    capacity String
    Provisioned capacity
    capacityBytes Number
    capacityMaxBytes Number
    capacityMinBytes Number
    hostPath String
    Host path
    id String
    The provider-assigned unique ID for this managed resource.
    state String
    State

    Look up Existing DynamicHostVolume Resource

    Get an existing DynamicHostVolume 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?: DynamicHostVolumeState, opts?: CustomResourceOptions): DynamicHostVolume
    @staticmethod
    def get(resource_name: str,
            id: str,
            opts: Optional[ResourceOptions] = None,
            capabilities: Optional[Sequence[DynamicHostVolumeCapabilityArgs]] = None,
            capacity: Optional[str] = None,
            capacity_bytes: Optional[int] = None,
            capacity_max: Optional[str] = None,
            capacity_max_bytes: Optional[int] = None,
            capacity_min: Optional[str] = None,
            capacity_min_bytes: Optional[int] = None,
            constraints: Optional[Sequence[DynamicHostVolumeConstraintArgs]] = None,
            host_path: Optional[str] = None,
            name: Optional[str] = None,
            namespace: Optional[str] = None,
            node_id: Optional[str] = None,
            node_pool: Optional[str] = None,
            parameters: Optional[Mapping[str, str]] = None,
            plugin_id: Optional[str] = None,
            state: Optional[str] = None) -> DynamicHostVolume
    func GetDynamicHostVolume(ctx *Context, name string, id IDInput, state *DynamicHostVolumeState, opts ...ResourceOption) (*DynamicHostVolume, error)
    public static DynamicHostVolume Get(string name, Input<string> id, DynamicHostVolumeState? state, CustomResourceOptions? opts = null)
    public static DynamicHostVolume get(String name, Output<String> id, DynamicHostVolumeState state, CustomResourceOptions options)
    resources:  _:    type: nomad:DynamicHostVolume    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:
    Capabilities List<DynamicHostVolumeCapability>
    (block: <optional>) - Option for validating the capability of a volume. Each capability block has the following attributes:
    Capacity string
    Provisioned capacity
    CapacityBytes int
    CapacityMax string
    (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 capacity_min and capacity_max; the exact behavior is up to the plugin. If you want to specify an exact size, set capacity_min and capacity_max to the same value. Accepts human-friendly suffixes such as "100GiB". Plugins that cannot restrict the size of volumes may ignore this field.
    CapacityMaxBytes int
    CapacityMin 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 capacity_min and capacity_max; the exact behavior is up to the plugin. If you want to specify an exact size, set capacity_min and capacity_max to the same value. Accepts human-friendly suffixes such as "100GiB". Plugins that cannot restrict the size of volumes may ignore this field.
    CapacityMinBytes int
    Constraints List<DynamicHostVolumeConstraint>
    (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.
    HostPath string
    Host path
    Name string
    (string: <required>) - The name of the volume, which is used as the [volume.source][volume_source] 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.
    Namespace 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.
    NodeId string
    (string: <optional>) - A specific node where you would like the volume to be created.
    NodePool string
    (string: <optional>) - A specific node pool where you would like the volume to be created. If you also provide node_id, the node must be in the provided node_pool.
    Parameters Dictionary<string, 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.
    PluginId string
    Plugin ID
    State string
    State
    Capabilities []DynamicHostVolumeCapabilityArgs
    (block: <optional>) - Option for validating the capability of a volume. Each capability block has the following attributes:
    Capacity string
    Provisioned capacity
    CapacityBytes int
    CapacityMax string
    (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 capacity_min and capacity_max; the exact behavior is up to the plugin. If you want to specify an exact size, set capacity_min and capacity_max to the same value. Accepts human-friendly suffixes such as "100GiB". Plugins that cannot restrict the size of volumes may ignore this field.
    CapacityMaxBytes int
    CapacityMin 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 capacity_min and capacity_max; the exact behavior is up to the plugin. If you want to specify an exact size, set capacity_min and capacity_max to the same value. Accepts human-friendly suffixes such as "100GiB". Plugins that cannot restrict the size of volumes may ignore this field.
    CapacityMinBytes int
    Constraints []DynamicHostVolumeConstraintArgs
    (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.
    HostPath string
    Host path
    Name string
    (string: <required>) - The name of the volume, which is used as the [volume.source][volume_source] 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.
    Namespace 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.
    NodeId string
    (string: <optional>) - A specific node where you would like the volume to be created.
    NodePool string
    (string: <optional>) - A specific node pool where you would like the volume to be created. If you also provide node_id, the node must be in the provided node_pool.
    Parameters map[string]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.
    PluginId string
    Plugin ID
    State string
    State
    capabilities List<DynamicHostVolumeCapability>
    (block: <optional>) - Option for validating the capability of a volume. Each capability block has the following attributes:
    capacity String
    Provisioned capacity
    capacityBytes Integer
    capacityMax String
    (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 capacity_min and capacity_max; the exact behavior is up to the plugin. If you want to specify an exact size, set capacity_min and capacity_max to the same value. Accepts human-friendly suffixes such as "100GiB". Plugins that cannot restrict the size of volumes may ignore this field.
    capacityMaxBytes Integer
    capacityMin 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 capacity_min and capacity_max; the exact behavior is up to the plugin. If you want to specify an exact size, set capacity_min and capacity_max to the same value. Accepts human-friendly suffixes such as "100GiB". Plugins that cannot restrict the size of volumes may ignore this field.
    capacityMinBytes Integer
    constraints List<DynamicHostVolumeConstraint>
    (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.
    hostPath String
    Host path
    name String
    (string: <required>) - The name of the volume, which is used as the [volume.source][volume_source] 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.
    namespace 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.
    nodeId String
    (string: <optional>) - A specific node where you would like the volume to be created.
    nodePool String
    (string: <optional>) - A specific node pool where you would like the volume to be created. If you also provide node_id, the node must be in the provided node_pool.
    parameters Map<String,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.
    pluginId String
    Plugin ID
    state String
    State
    capabilities DynamicHostVolumeCapability[]
    (block: <optional>) - Option for validating the capability of a volume. Each capability block has the following attributes:
    capacity string
    Provisioned capacity
    capacityBytes number
    capacityMax string
    (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 capacity_min and capacity_max; the exact behavior is up to the plugin. If you want to specify an exact size, set capacity_min and capacity_max to the same value. Accepts human-friendly suffixes such as "100GiB". Plugins that cannot restrict the size of volumes may ignore this field.
    capacityMaxBytes number
    capacityMin 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 capacity_min and capacity_max; the exact behavior is up to the plugin. If you want to specify an exact size, set capacity_min and capacity_max to the same value. Accepts human-friendly suffixes such as "100GiB". Plugins that cannot restrict the size of volumes may ignore this field.
    capacityMinBytes number
    constraints DynamicHostVolumeConstraint[]
    (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.
    hostPath string
    Host path
    name string
    (string: <required>) - The name of the volume, which is used as the [volume.source][volume_source] 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.
    namespace 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.
    nodeId string
    (string: <optional>) - A specific node where you would like the volume to be created.
    nodePool string
    (string: <optional>) - A specific node pool where you would like the volume to be created. If you also provide node_id, the node must be in the provided node_pool.
    parameters {[key: string]: 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.
    pluginId string
    Plugin ID
    state string
    State
    capabilities Sequence[DynamicHostVolumeCapabilityArgs]
    (block: <optional>) - Option for validating the capability of a volume. Each capability block has the following attributes:
    capacity str
    Provisioned capacity
    capacity_bytes int
    capacity_max str
    (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 capacity_min and capacity_max; the exact behavior is up to the plugin. If you want to specify an exact size, set capacity_min and capacity_max to the same value. Accepts human-friendly suffixes such as "100GiB". Plugins that cannot restrict the size of volumes may ignore this field.
    capacity_max_bytes int
    capacity_min str
    (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 capacity_min and capacity_max; the exact behavior is up to the plugin. If you want to specify an exact size, set capacity_min and capacity_max to the same value. Accepts human-friendly suffixes such as "100GiB". Plugins that cannot restrict the size of volumes may ignore this field.
    capacity_min_bytes int
    constraints Sequence[DynamicHostVolumeConstraintArgs]
    (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.
    host_path str
    Host path
    name str
    (string: <required>) - The name of the volume, which is used as the [volume.source][volume_source] 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.
    namespace str
    (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.
    node_id str
    (string: <optional>) - A specific node where you would like the volume to be created.
    node_pool str
    (string: <optional>) - A specific node pool where you would like the volume to be created. If you also provide node_id, the node must be in the provided node_pool.
    parameters Mapping[str, str]
    (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.
    plugin_id str
    Plugin ID
    state str
    State
    capabilities List<Property Map>
    (block: <optional>) - Option for validating the capability of a volume. Each capability block has the following attributes:
    capacity String
    Provisioned capacity
    capacityBytes Number
    capacityMax String
    (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 capacity_min and capacity_max; the exact behavior is up to the plugin. If you want to specify an exact size, set capacity_min and capacity_max to the same value. Accepts human-friendly suffixes such as "100GiB". Plugins that cannot restrict the size of volumes may ignore this field.
    capacityMaxBytes Number
    capacityMin 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 capacity_min and capacity_max; the exact behavior is up to the plugin. If you want to specify an exact size, set capacity_min and capacity_max to the same value. Accepts human-friendly suffixes such as "100GiB". Plugins that cannot restrict the size of volumes may ignore this field.
    capacityMinBytes Number
    constraints List<Property Map>
    (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.
    hostPath String
    Host path
    name String
    (string: <required>) - The name of the volume, which is used as the [volume.source][volume_source] 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.
    namespace 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.
    nodeId String
    (string: <optional>) - A specific node where you would like the volume to be created.
    nodePool String
    (string: <optional>) - A specific node pool where you would like the volume to be created. If you also provide node_id, the node must be in the provided node_pool.
    parameters Map<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.
    pluginId String
    Plugin ID
    state String
    State

    Supporting Types

    DynamicHostVolumeCapability, DynamicHostVolumeCapabilityArgs

    AccessMode string
    (string) - How the volume can be mounted by allocations. Refer to the [access_mode][] documentation for details.
    AttachmentMode string
    (string) - The storage API that will be used by the volume. Refer to the [attachment_mode][] documentation.
    AccessMode string
    (string) - How the volume can be mounted by allocations. Refer to the [access_mode][] documentation for details.
    AttachmentMode string
    (string) - The storage API that will be used by the volume. Refer to the [attachment_mode][] documentation.
    accessMode String
    (string) - How the volume can be mounted by allocations. Refer to the [access_mode][] documentation for details.
    attachmentMode String
    (string) - The storage API that will be used by the volume. Refer to the [attachment_mode][] documentation.
    accessMode string
    (string) - How the volume can be mounted by allocations. Refer to the [access_mode][] documentation for details.
    attachmentMode string
    (string) - The storage API that will be used by the volume. Refer to the [attachment_mode][] documentation.
    access_mode str
    (string) - How the volume can be mounted by allocations. Refer to the [access_mode][] documentation for details.
    attachment_mode str
    (string) - The storage API that will be used by the volume. Refer to the [attachment_mode][] documentation.
    accessMode String
    (string) - How the volume can be mounted by allocations. Refer to the [access_mode][] documentation for details.
    attachmentMode String
    (string) - The storage API that will be used by the volume. Refer to the [attachment_mode][] documentation.

    DynamicHostVolumeConstraint, DynamicHostVolumeConstraintArgs

    Attribute string
    (string) - The [node attribute][] to check for the constraint.
    Operator string
    (string)- The operator to use in the comparison.
    Value string
    (string) - The value of the attribute to compare against.
    Attribute string
    (string) - The [node attribute][] to check for the constraint.
    Operator string
    (string)- The operator to use in the comparison.
    Value string
    (string) - The value of the attribute to compare against.
    attribute String
    (string) - The [node attribute][] to check for the constraint.
    operator String
    (string)- The operator to use in the comparison.
    value String
    (string) - The value of the attribute to compare against.
    attribute string
    (string) - The [node attribute][] to check for the constraint.
    operator string
    (string)- The operator to use in the comparison.
    value string
    (string) - The value of the attribute to compare against.
    attribute str
    (string) - The [node attribute][] to check for the constraint.
    operator str
    (string)- The operator to use in the comparison.
    value str
    (string) - The value of the attribute to compare against.
    attribute String
    (string) - The [node attribute][] to check for the constraint.
    operator String
    (string)- The operator to use in the comparison.
    value String
    (string) - The value of the attribute to compare against.

    Package Details

    Repository
    HashiCorp Nomad pulumi/pulumi-nomad
    License
    Apache-2.0
    Notes
    This Pulumi package is based on the nomad Terraform Provider.
    nomad logo
    Nomad v2.5.0 published on Thursday, Apr 17, 2025 by Pulumi