1. Packages
  2. HashiCorp Nomad
  3. API Docs
  4. ExternalVolume
Nomad v2.2.0 published on Wednesday, Mar 13, 2024 by Pulumi

nomad.ExternalVolume

Explore with Pulumi AI

nomad logo
Nomad v2.2.0 published on Wednesday, Mar 13, 2024 by Pulumi

    Example Usage

    Creating a volume:

    import * as pulumi from "@pulumi/pulumi";
    import * as nomad from "@pulumi/nomad";
    
    const ebs = nomad.getPlugin({
        pluginId: "aws-ebs0",
        waitForHealthy: true,
    });
    const mysqlVolume = new nomad.ExternalVolume("mysqlVolume", {
        type: "csi",
        pluginId: "aws-ebs0",
        volumeId: "mysql_volume",
        capacityMin: "10GiB",
        capacityMax: "20GiB",
        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],
    });
    
    import pulumi
    import pulumi_nomad as nomad
    
    ebs = nomad.get_plugin(plugin_id="aws-ebs0",
        wait_for_healthy=True)
    mysql_volume = nomad.ExternalVolume("mysqlVolume",
        type="csi",
        plugin_id="aws-ebs0",
        volume_id="mysql_volume",
        capacity_min="10GiB",
        capacity_max="20GiB",
        capabilities=[nomad.ExternalVolumeCapabilityArgs(
            access_mode="single-node-writer",
            attachment_mode="file-system",
        )],
        mount_options=nomad.ExternalVolumeMountOptionsArgs(
            fs_type="ext4",
        ),
        topology_request=nomad.ExternalVolumeTopologyRequestArgs(
            required=nomad.ExternalVolumeTopologyRequestRequiredArgs(
                topologies=[
                    nomad.ExternalVolumeTopologyRequestRequiredTopologyArgs(
                        segments={
                            "rack": "R1",
                            "zone": "us-east-1a",
                        },
                    ),
                    nomad.ExternalVolumeTopologyRequestRequiredTopologyArgs(
                        segments={
                            "rack": "R2",
                        },
                    ),
                ],
            ),
        ),
        opts=pulumi.ResourceOptions(depends_on=[ebs]))
    
    package main
    
    import (
    	"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 {
    		ebs, err := nomad.GetPlugin(ctx, &nomad.GetPluginArgs{
    			PluginId:       "aws-ebs0",
    			WaitForHealthy: pulumi.BoolRef(true),
    		}, nil)
    		if err != nil {
    			return err
    		}
    		_, err = nomad.NewExternalVolume(ctx, "mysqlVolume", &nomad.ExternalVolumeArgs{
    			Type:        pulumi.String("csi"),
    			PluginId:    pulumi.String("aws-ebs0"),
    			VolumeId:    pulumi.String("mysql_volume"),
    			CapacityMin: pulumi.String("10GiB"),
    			CapacityMax: pulumi.String("20GiB"),
    			Capabilities: nomad.ExternalVolumeCapabilityArray{
    				&nomad.ExternalVolumeCapabilityArgs{
    					AccessMode:     pulumi.String("single-node-writer"),
    					AttachmentMode: pulumi.String("file-system"),
    				},
    			},
    			MountOptions: &nomad.ExternalVolumeMountOptionsArgs{
    				FsType: pulumi.String("ext4"),
    			},
    			TopologyRequest: &nomad.ExternalVolumeTopologyRequestArgs{
    				Required: &nomad.ExternalVolumeTopologyRequestRequiredArgs{
    					Topologies: nomad.ExternalVolumeTopologyRequestRequiredTopologyArray{
    						&nomad.ExternalVolumeTopologyRequestRequiredTopologyArgs{
    							Segments: pulumi.StringMap{
    								"rack": pulumi.String("R1"),
    								"zone": pulumi.String("us-east-1a"),
    							},
    						},
    						&nomad.ExternalVolumeTopologyRequestRequiredTopologyArgs{
    							Segments: pulumi.StringMap{
    								"rack": pulumi.String("R2"),
    							},
    						},
    					},
    				},
    			},
    		}, pulumi.DependsOn([]pulumi.Resource{
    			ebs,
    		}))
    		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 ebs = Nomad.GetPlugin.Invoke(new()
        {
            PluginId = "aws-ebs0",
            WaitForHealthy = true,
        });
    
        var mysqlVolume = new Nomad.ExternalVolume("mysqlVolume", new()
        {
            Type = "csi",
            PluginId = "aws-ebs0",
            VolumeId = "mysql_volume",
            CapacityMin = "10GiB",
            CapacityMax = "20GiB",
            Capabilities = new[]
            {
                new Nomad.Inputs.ExternalVolumeCapabilityArgs
                {
                    AccessMode = "single-node-writer",
                    AttachmentMode = "file-system",
                },
            },
            MountOptions = new Nomad.Inputs.ExternalVolumeMountOptionsArgs
            {
                FsType = "ext4",
            },
            TopologyRequest = new Nomad.Inputs.ExternalVolumeTopologyRequestArgs
            {
                Required = new Nomad.Inputs.ExternalVolumeTopologyRequestRequiredArgs
                {
                    Topologies = new[]
                    {
                        new Nomad.Inputs.ExternalVolumeTopologyRequestRequiredTopologyArgs
                        {
                            Segments = 
                            {
                                { "rack", "R1" },
                                { "zone", "us-east-1a" },
                            },
                        },
                        new Nomad.Inputs.ExternalVolumeTopologyRequestRequiredTopologyArgs
                        {
                            Segments = 
                            {
                                { "rack", "R2" },
                            },
                        },
                    },
                },
            },
        }, new CustomResourceOptions
        {
            DependsOn = new[]
            {
                ebs,
            },
        });
    
    });
    
    package generated_program;
    
    import com.pulumi.Context;
    import com.pulumi.Pulumi;
    import com.pulumi.core.Output;
    import com.pulumi.nomad.NomadFunctions;
    import com.pulumi.nomad.inputs.GetPluginArgs;
    import com.pulumi.nomad.ExternalVolume;
    import com.pulumi.nomad.ExternalVolumeArgs;
    import com.pulumi.nomad.inputs.ExternalVolumeCapabilityArgs;
    import com.pulumi.nomad.inputs.ExternalVolumeMountOptionsArgs;
    import com.pulumi.nomad.inputs.ExternalVolumeTopologyRequestArgs;
    import com.pulumi.nomad.inputs.ExternalVolumeTopologyRequestRequiredArgs;
    import com.pulumi.resources.CustomResourceOptions;
    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 ebs = NomadFunctions.getPlugin(GetPluginArgs.builder()
                .pluginId("aws-ebs0")
                .waitForHealthy(true)
                .build());
    
            var mysqlVolume = new ExternalVolume("mysqlVolume", ExternalVolumeArgs.builder()        
                .type("csi")
                .pluginId("aws-ebs0")
                .volumeId("mysql_volume")
                .capacityMin("10GiB")
                .capacityMax("20GiB")
                .capabilities(ExternalVolumeCapabilityArgs.builder()
                    .accessMode("single-node-writer")
                    .attachmentMode("file-system")
                    .build())
                .mountOptions(ExternalVolumeMountOptionsArgs.builder()
                    .fsType("ext4")
                    .build())
                .topologyRequest(ExternalVolumeTopologyRequestArgs.builder()
                    .required(ExternalVolumeTopologyRequestRequiredArgs.builder()
                        .topologies(                    
                            ExternalVolumeTopologyRequestRequiredTopologyArgs.builder()
                                .segments(Map.ofEntries(
                                    Map.entry("rack", "R1"),
                                    Map.entry("zone", "us-east-1a")
                                ))
                                .build(),
                            ExternalVolumeTopologyRequestRequiredTopologyArgs.builder()
                                .segments(Map.of("rack", "R2"))
                                .build())
                        .build())
                    .build())
                .build(), CustomResourceOptions.builder()
                    .dependsOn(ebs.applyValue(getPluginResult -> getPluginResult))
                    .build());
    
        }
    }
    
    resources:
      mysqlVolume:
        type: nomad:ExternalVolume
        properties:
          type: csi
          pluginId: aws-ebs0
          volumeId: mysql_volume
          capacityMin: 10GiB
          capacityMax: 20GiB
          capabilities:
            - accessMode: single-node-writer
              attachmentMode: file-system
          mountOptions:
            fsType: ext4
          topologyRequest:
            required:
              topologies:
                - segments:
                    rack: R1
                    zone: us-east-1a
                - segments:
                    rack: R2
        options:
          dependson:
            - ${ebs}
    variables:
      ebs:
        fn::invoke:
          Function: nomad:getPlugin
          Arguments:
            pluginId: aws-ebs0
            waitForHealthy: true
    

    Create ExternalVolume Resource

    new ExternalVolume(name: string, args: ExternalVolumeArgs, opts?: CustomResourceOptions);
    @overload
    def ExternalVolume(resource_name: str,
                       opts: Optional[ResourceOptions] = None,
                       capabilities: Optional[Sequence[ExternalVolumeCapabilityArgs]] = None,
                       capacity_max: Optional[str] = None,
                       capacity_min: Optional[str] = None,
                       clone_id: Optional[str] = None,
                       mount_options: Optional[ExternalVolumeMountOptionsArgs] = None,
                       name: Optional[str] = None,
                       namespace: Optional[str] = None,
                       parameters: Optional[Mapping[str, str]] = None,
                       plugin_id: Optional[str] = None,
                       secrets: Optional[Mapping[str, str]] = None,
                       snapshot_id: Optional[str] = None,
                       topology_request: Optional[ExternalVolumeTopologyRequestArgs] = None,
                       type: Optional[str] = None,
                       volume_id: Optional[str] = None)
    @overload
    def ExternalVolume(resource_name: str,
                       args: ExternalVolumeArgs,
                       opts: Optional[ResourceOptions] = None)
    func NewExternalVolume(ctx *Context, name string, args ExternalVolumeArgs, opts ...ResourceOption) (*ExternalVolume, error)
    public ExternalVolume(string name, ExternalVolumeArgs args, CustomResourceOptions? opts = null)
    public ExternalVolume(String name, ExternalVolumeArgs args)
    public ExternalVolume(String name, ExternalVolumeArgs args, CustomResourceOptions options)
    
    type: nomad:ExternalVolume
    properties: # The arguments to resource properties.
    options: # Bag of options to control resource's behavior.
    
    
    name string
    The unique name of the resource.
    args ExternalVolumeArgs
    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 ExternalVolumeArgs
    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 ExternalVolumeArgs
    The arguments to resource properties.
    opts ResourceOption
    Bag of options to control resource's behavior.
    name string
    The unique name of the resource.
    args ExternalVolumeArgs
    The arguments to resource properties.
    opts CustomResourceOptions
    Bag of options to control resource's behavior.
    name String
    The unique name of the resource.
    args ExternalVolumeArgs
    The arguments to resource properties.
    options CustomResourceOptions
    Bag of options to control resource's behavior.

    ExternalVolume Resource Properties

    To learn more about resource properties and how to use them, see Inputs and Outputs in the Architecture and Concepts docs.

    Inputs

    The ExternalVolume resource accepts the following input properties:

    Capabilities List<ExternalVolumeCapability>
    (``Capability``: <required>) - Options for validating the capability of a volume.
    PluginId string
    (string: <required>) - The ID of the Nomad plugin for registering this volume.
    VolumeId string
    (string: <required>) - The unique ID of the volume.
    CapacityMax string
    (string: <optional>) - Option to signal a maximum volume size. This may not be supported by all storage providers.
    CapacityMin string
    (string: <optional>) - Option to signal a minimum volume size. This may not be supported by all storage providers.
    CloneId string
    (string: <optional>) - The external ID of an existing volume to restore. If ommited, the volume will be created from scratch. Conflicts with snapshot_id.
    MountOptions ExternalVolumeMountOptions
    (block: optional) Options for mounting block-device volumes without a pre-formatted file system.
    Name string
    (string: <required>) - The display name for the volume.
    Namespace string
    (string: "default") - The namespace in which to register the volume.
    Parameters Dictionary<string, string>
    (map[string]string: optional) An optional key-value map of strings passed directly to the CSI plugin to configure the volume.
    Secrets Dictionary<string, string>
    (map[string]string: optional) An optional key-value map of strings used as credentials for publishing and unpublishing volumes.
    SnapshotId string
    (string: <optional>) - The external ID of a snapshot to restore. If ommited, the volume will be created from scratch. Conflicts with clone_id.
    TopologyRequest ExternalVolumeTopologyRequest
    (``TopologyRequest``: <optional>) - Specify locations (region, zone, rack, etc.) where the provisioned volume is accessible from.
    Type string
    (string: <required>) - The type of the volume. Currently, only csi is supported.
    Capabilities []ExternalVolumeCapabilityArgs
    (``Capability``: <required>) - Options for validating the capability of a volume.
    PluginId string
    (string: <required>) - The ID of the Nomad plugin for registering this volume.
    VolumeId string
    (string: <required>) - The unique ID of the volume.
    CapacityMax string
    (string: <optional>) - Option to signal a maximum volume size. This may not be supported by all storage providers.
    CapacityMin string
    (string: <optional>) - Option to signal a minimum volume size. This may not be supported by all storage providers.
    CloneId string
    (string: <optional>) - The external ID of an existing volume to restore. If ommited, the volume will be created from scratch. Conflicts with snapshot_id.
    MountOptions ExternalVolumeMountOptionsArgs
    (block: optional) Options for mounting block-device volumes without a pre-formatted file system.
    Name string
    (string: <required>) - The display name for the volume.
    Namespace string
    (string: "default") - The namespace in which to register the volume.
    Parameters map[string]string
    (map[string]string: optional) An optional key-value map of strings passed directly to the CSI plugin to configure the volume.
    Secrets map[string]string
    (map[string]string: optional) An optional key-value map of strings used as credentials for publishing and unpublishing volumes.
    SnapshotId string
    (string: <optional>) - The external ID of a snapshot to restore. If ommited, the volume will be created from scratch. Conflicts with clone_id.
    TopologyRequest ExternalVolumeTopologyRequestArgs
    (``TopologyRequest``: <optional>) - Specify locations (region, zone, rack, etc.) where the provisioned volume is accessible from.
    Type string
    (string: <required>) - The type of the volume. Currently, only csi is supported.
    capabilities List<ExternalVolumeCapability>
    (``Capability``: <required>) - Options for validating the capability of a volume.
    pluginId String
    (string: <required>) - The ID of the Nomad plugin for registering this volume.
    volumeId String
    (string: <required>) - The unique ID of the volume.
    capacityMax String
    (string: <optional>) - Option to signal a maximum volume size. This may not be supported by all storage providers.
    capacityMin String
    (string: <optional>) - Option to signal a minimum volume size. This may not be supported by all storage providers.
    cloneId String
    (string: <optional>) - The external ID of an existing volume to restore. If ommited, the volume will be created from scratch. Conflicts with snapshot_id.
    mountOptions ExternalVolumeMountOptions
    (block: optional) Options for mounting block-device volumes without a pre-formatted file system.
    name String
    (string: <required>) - The display name for the volume.
    namespace String
    (string: "default") - The namespace in which to register the volume.
    parameters Map<String,String>
    (map[string]string: optional) An optional key-value map of strings passed directly to the CSI plugin to configure the volume.
    secrets Map<String,String>
    (map[string]string: optional) An optional key-value map of strings used as credentials for publishing and unpublishing volumes.
    snapshotId String
    (string: <optional>) - The external ID of a snapshot to restore. If ommited, the volume will be created from scratch. Conflicts with clone_id.
    topologyRequest ExternalVolumeTopologyRequest
    (``TopologyRequest``: <optional>) - Specify locations (region, zone, rack, etc.) where the provisioned volume is accessible from.
    type String
    (string: <required>) - The type of the volume. Currently, only csi is supported.
    capabilities ExternalVolumeCapability[]
    (``Capability``: <required>) - Options for validating the capability of a volume.
    pluginId string
    (string: <required>) - The ID of the Nomad plugin for registering this volume.
    volumeId string
    (string: <required>) - The unique ID of the volume.
    capacityMax string
    (string: <optional>) - Option to signal a maximum volume size. This may not be supported by all storage providers.
    capacityMin string
    (string: <optional>) - Option to signal a minimum volume size. This may not be supported by all storage providers.
    cloneId string
    (string: <optional>) - The external ID of an existing volume to restore. If ommited, the volume will be created from scratch. Conflicts with snapshot_id.
    mountOptions ExternalVolumeMountOptions
    (block: optional) Options for mounting block-device volumes without a pre-formatted file system.
    name string
    (string: <required>) - The display name for the volume.
    namespace string
    (string: "default") - The namespace in which to register the volume.
    parameters {[key: string]: string}
    (map[string]string: optional) An optional key-value map of strings passed directly to the CSI plugin to configure the volume.
    secrets {[key: string]: string}
    (map[string]string: optional) An optional key-value map of strings used as credentials for publishing and unpublishing volumes.
    snapshotId string
    (string: <optional>) - The external ID of a snapshot to restore. If ommited, the volume will be created from scratch. Conflicts with clone_id.
    topologyRequest ExternalVolumeTopologyRequest
    (``TopologyRequest``: <optional>) - Specify locations (region, zone, rack, etc.) where the provisioned volume is accessible from.
    type string
    (string: <required>) - The type of the volume. Currently, only csi is supported.
    capabilities Sequence[ExternalVolumeCapabilityArgs]
    (``Capability``: <required>) - Options for validating the capability of a volume.
    plugin_id str
    (string: <required>) - The ID of the Nomad plugin for registering this volume.
    volume_id str
    (string: <required>) - The unique ID of the volume.
    capacity_max str
    (string: <optional>) - Option to signal a maximum volume size. This may not be supported by all storage providers.
    capacity_min str
    (string: <optional>) - Option to signal a minimum volume size. This may not be supported by all storage providers.
    clone_id str
    (string: <optional>) - The external ID of an existing volume to restore. If ommited, the volume will be created from scratch. Conflicts with snapshot_id.
    mount_options ExternalVolumeMountOptionsArgs
    (block: optional) Options for mounting block-device volumes without a pre-formatted file system.
    name str
    (string: <required>) - The display name for the volume.
    namespace str
    (string: "default") - The namespace in which to register the volume.
    parameters Mapping[str, str]
    (map[string]string: optional) An optional key-value map of strings passed directly to the CSI plugin to configure the volume.
    secrets Mapping[str, str]
    (map[string]string: optional) An optional key-value map of strings used as credentials for publishing and unpublishing volumes.
    snapshot_id str
    (string: <optional>) - The external ID of a snapshot to restore. If ommited, the volume will be created from scratch. Conflicts with clone_id.
    topology_request ExternalVolumeTopologyRequestArgs
    (``TopologyRequest``: <optional>) - Specify locations (region, zone, rack, etc.) where the provisioned volume is accessible from.
    type str
    (string: <required>) - The type of the volume. Currently, only csi is supported.
    capabilities List<Property Map>
    (``Capability``: <required>) - Options for validating the capability of a volume.
    pluginId String
    (string: <required>) - The ID of the Nomad plugin for registering this volume.
    volumeId String
    (string: <required>) - The unique ID of the volume.
    capacityMax String
    (string: <optional>) - Option to signal a maximum volume size. This may not be supported by all storage providers.
    capacityMin String
    (string: <optional>) - Option to signal a minimum volume size. This may not be supported by all storage providers.
    cloneId String
    (string: <optional>) - The external ID of an existing volume to restore. If ommited, the volume will be created from scratch. Conflicts with snapshot_id.
    mountOptions Property Map
    (block: optional) Options for mounting block-device volumes without a pre-formatted file system.
    name String
    (string: <required>) - The display name for the volume.
    namespace String
    (string: "default") - The namespace in which to register the volume.
    parameters Map<String>
    (map[string]string: optional) An optional key-value map of strings passed directly to the CSI plugin to configure the volume.
    secrets Map<String>
    (map[string]string: optional) An optional key-value map of strings used as credentials for publishing and unpublishing volumes.
    snapshotId String
    (string: <optional>) - The external ID of a snapshot to restore. If ommited, the volume will be created from scratch. Conflicts with clone_id.
    topologyRequest Property Map
    (``TopologyRequest``: <optional>) - Specify locations (region, zone, rack, etc.) where the provisioned volume is accessible from.
    type String
    (string: <required>) - The type of the volume. Currently, only csi is supported.

    Outputs

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

    ControllerRequired bool
    (boolean)
    ControllersExpected int
    (integer)
    ControllersHealthy int
    (integer)
    Id string
    The provider-assigned unique ID for this managed resource.
    NodesExpected int
    (integer)
    NodesHealthy int
    (integer)
    PluginProvider string
    (string)
    PluginProviderVersion string
    (string)
    Schedulable bool
    (boolean)
    Topologies List<ExternalVolumeTopology>
    (List of topologies)
    ControllerRequired bool
    (boolean)
    ControllersExpected int
    (integer)
    ControllersHealthy int
    (integer)
    Id string
    The provider-assigned unique ID for this managed resource.
    NodesExpected int
    (integer)
    NodesHealthy int
    (integer)
    PluginProvider string
    (string)
    PluginProviderVersion string
    (string)
    Schedulable bool
    (boolean)
    Topologies []ExternalVolumeTopology
    (List of topologies)
    controllerRequired Boolean
    (boolean)
    controllersExpected Integer
    (integer)
    controllersHealthy Integer
    (integer)
    id String
    The provider-assigned unique ID for this managed resource.
    nodesExpected Integer
    (integer)
    nodesHealthy Integer
    (integer)
    pluginProvider String
    (string)
    pluginProviderVersion String
    (string)
    schedulable Boolean
    (boolean)
    topologies List<ExternalVolumeTopology>
    (List of topologies)
    controllerRequired boolean
    (boolean)
    controllersExpected number
    (integer)
    controllersHealthy number
    (integer)
    id string
    The provider-assigned unique ID for this managed resource.
    nodesExpected number
    (integer)
    nodesHealthy number
    (integer)
    pluginProvider string
    (string)
    pluginProviderVersion string
    (string)
    schedulable boolean
    (boolean)
    topologies ExternalVolumeTopology[]
    (List of topologies)
    controller_required bool
    (boolean)
    controllers_expected int
    (integer)
    controllers_healthy int
    (integer)
    id str
    The provider-assigned unique ID for this managed resource.
    nodes_expected int
    (integer)
    nodes_healthy int
    (integer)
    plugin_provider str
    (string)
    plugin_provider_version str
    (string)
    schedulable bool
    (boolean)
    topologies Sequence[ExternalVolumeTopology]
    (List of topologies)
    controllerRequired Boolean
    (boolean)
    controllersExpected Number
    (integer)
    controllersHealthy Number
    (integer)
    id String
    The provider-assigned unique ID for this managed resource.
    nodesExpected Number
    (integer)
    nodesHealthy Number
    (integer)
    pluginProvider String
    (string)
    pluginProviderVersion String
    (string)
    schedulable Boolean
    (boolean)
    topologies List<Property Map>
    (List of topologies)

    Look up Existing ExternalVolume Resource

    Get an existing ExternalVolume 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?: ExternalVolumeState, opts?: CustomResourceOptions): ExternalVolume
    @staticmethod
    def get(resource_name: str,
            id: str,
            opts: Optional[ResourceOptions] = None,
            capabilities: Optional[Sequence[ExternalVolumeCapabilityArgs]] = None,
            capacity_max: Optional[str] = None,
            capacity_min: Optional[str] = None,
            clone_id: Optional[str] = None,
            controller_required: Optional[bool] = None,
            controllers_expected: Optional[int] = None,
            controllers_healthy: Optional[int] = None,
            mount_options: Optional[ExternalVolumeMountOptionsArgs] = None,
            name: Optional[str] = None,
            namespace: Optional[str] = None,
            nodes_expected: Optional[int] = None,
            nodes_healthy: Optional[int] = None,
            parameters: Optional[Mapping[str, str]] = None,
            plugin_id: Optional[str] = None,
            plugin_provider: Optional[str] = None,
            plugin_provider_version: Optional[str] = None,
            schedulable: Optional[bool] = None,
            secrets: Optional[Mapping[str, str]] = None,
            snapshot_id: Optional[str] = None,
            topologies: Optional[Sequence[ExternalVolumeTopologyArgs]] = None,
            topology_request: Optional[ExternalVolumeTopologyRequestArgs] = None,
            type: Optional[str] = None,
            volume_id: Optional[str] = None) -> ExternalVolume
    func GetExternalVolume(ctx *Context, name string, id IDInput, state *ExternalVolumeState, opts ...ResourceOption) (*ExternalVolume, error)
    public static ExternalVolume Get(string name, Input<string> id, ExternalVolumeState? state, CustomResourceOptions? opts = null)
    public static ExternalVolume get(String name, Output<String> id, ExternalVolumeState state, CustomResourceOptions options)
    Resource lookup is not supported in YAML
    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<ExternalVolumeCapability>
    (``Capability``: <required>) - Options for validating the capability of a volume.
    CapacityMax string
    (string: <optional>) - Option to signal a maximum volume size. This may not be supported by all storage providers.
    CapacityMin string
    (string: <optional>) - Option to signal a minimum volume size. This may not be supported by all storage providers.
    CloneId string
    (string: <optional>) - The external ID of an existing volume to restore. If ommited, the volume will be created from scratch. Conflicts with snapshot_id.
    ControllerRequired bool
    (boolean)
    ControllersExpected int
    (integer)
    ControllersHealthy int
    (integer)
    MountOptions ExternalVolumeMountOptions
    (block: optional) Options for mounting block-device volumes without a pre-formatted file system.
    Name string
    (string: <required>) - The display name for the volume.
    Namespace string
    (string: "default") - The namespace in which to register the volume.
    NodesExpected int
    (integer)
    NodesHealthy int
    (integer)
    Parameters Dictionary<string, string>
    (map[string]string: optional) An optional key-value map of strings passed directly to the CSI plugin to configure the volume.
    PluginId string
    (string: <required>) - The ID of the Nomad plugin for registering this volume.
    PluginProvider string
    (string)
    PluginProviderVersion string
    (string)
    Schedulable bool
    (boolean)
    Secrets Dictionary<string, string>
    (map[string]string: optional) An optional key-value map of strings used as credentials for publishing and unpublishing volumes.
    SnapshotId string
    (string: <optional>) - The external ID of a snapshot to restore. If ommited, the volume will be created from scratch. Conflicts with clone_id.
    Topologies List<ExternalVolumeTopology>
    (List of topologies)
    TopologyRequest ExternalVolumeTopologyRequest
    (``TopologyRequest``: <optional>) - Specify locations (region, zone, rack, etc.) where the provisioned volume is accessible from.
    Type string
    (string: <required>) - The type of the volume. Currently, only csi is supported.
    VolumeId string
    (string: <required>) - The unique ID of the volume.
    Capabilities []ExternalVolumeCapabilityArgs
    (``Capability``: <required>) - Options for validating the capability of a volume.
    CapacityMax string
    (string: <optional>) - Option to signal a maximum volume size. This may not be supported by all storage providers.
    CapacityMin string
    (string: <optional>) - Option to signal a minimum volume size. This may not be supported by all storage providers.
    CloneId string
    (string: <optional>) - The external ID of an existing volume to restore. If ommited, the volume will be created from scratch. Conflicts with snapshot_id.
    ControllerRequired bool
    (boolean)
    ControllersExpected int
    (integer)
    ControllersHealthy int
    (integer)
    MountOptions ExternalVolumeMountOptionsArgs
    (block: optional) Options for mounting block-device volumes without a pre-formatted file system.
    Name string
    (string: <required>) - The display name for the volume.
    Namespace string
    (string: "default") - The namespace in which to register the volume.
    NodesExpected int
    (integer)
    NodesHealthy int
    (integer)
    Parameters map[string]string
    (map[string]string: optional) An optional key-value map of strings passed directly to the CSI plugin to configure the volume.
    PluginId string
    (string: <required>) - The ID of the Nomad plugin for registering this volume.
    PluginProvider string
    (string)
    PluginProviderVersion string
    (string)
    Schedulable bool
    (boolean)
    Secrets map[string]string
    (map[string]string: optional) An optional key-value map of strings used as credentials for publishing and unpublishing volumes.
    SnapshotId string
    (string: <optional>) - The external ID of a snapshot to restore. If ommited, the volume will be created from scratch. Conflicts with clone_id.
    Topologies []ExternalVolumeTopologyArgs
    (List of topologies)
    TopologyRequest ExternalVolumeTopologyRequestArgs
    (``TopologyRequest``: <optional>) - Specify locations (region, zone, rack, etc.) where the provisioned volume is accessible from.
    Type string
    (string: <required>) - The type of the volume. Currently, only csi is supported.
    VolumeId string
    (string: <required>) - The unique ID of the volume.
    capabilities List<ExternalVolumeCapability>
    (``Capability``: <required>) - Options for validating the capability of a volume.
    capacityMax String
    (string: <optional>) - Option to signal a maximum volume size. This may not be supported by all storage providers.
    capacityMin String
    (string: <optional>) - Option to signal a minimum volume size. This may not be supported by all storage providers.
    cloneId String
    (string: <optional>) - The external ID of an existing volume to restore. If ommited, the volume will be created from scratch. Conflicts with snapshot_id.
    controllerRequired Boolean
    (boolean)
    controllersExpected Integer
    (integer)
    controllersHealthy Integer
    (integer)
    mountOptions ExternalVolumeMountOptions
    (block: optional) Options for mounting block-device volumes without a pre-formatted file system.
    name String
    (string: <required>) - The display name for the volume.
    namespace String
    (string: "default") - The namespace in which to register the volume.
    nodesExpected Integer
    (integer)
    nodesHealthy Integer
    (integer)
    parameters Map<String,String>
    (map[string]string: optional) An optional key-value map of strings passed directly to the CSI plugin to configure the volume.
    pluginId String
    (string: <required>) - The ID of the Nomad plugin for registering this volume.
    pluginProvider String
    (string)
    pluginProviderVersion String
    (string)
    schedulable Boolean
    (boolean)
    secrets Map<String,String>
    (map[string]string: optional) An optional key-value map of strings used as credentials for publishing and unpublishing volumes.
    snapshotId String
    (string: <optional>) - The external ID of a snapshot to restore. If ommited, the volume will be created from scratch. Conflicts with clone_id.
    topologies List<ExternalVolumeTopology>
    (List of topologies)
    topologyRequest ExternalVolumeTopologyRequest
    (``TopologyRequest``: <optional>) - Specify locations (region, zone, rack, etc.) where the provisioned volume is accessible from.
    type String
    (string: <required>) - The type of the volume. Currently, only csi is supported.
    volumeId String
    (string: <required>) - The unique ID of the volume.
    capabilities ExternalVolumeCapability[]
    (``Capability``: <required>) - Options for validating the capability of a volume.
    capacityMax string
    (string: <optional>) - Option to signal a maximum volume size. This may not be supported by all storage providers.
    capacityMin string
    (string: <optional>) - Option to signal a minimum volume size. This may not be supported by all storage providers.
    cloneId string
    (string: <optional>) - The external ID of an existing volume to restore. If ommited, the volume will be created from scratch. Conflicts with snapshot_id.
    controllerRequired boolean
    (boolean)
    controllersExpected number
    (integer)
    controllersHealthy number
    (integer)
    mountOptions ExternalVolumeMountOptions
    (block: optional) Options for mounting block-device volumes without a pre-formatted file system.
    name string
    (string: <required>) - The display name for the volume.
    namespace string
    (string: "default") - The namespace in which to register the volume.
    nodesExpected number
    (integer)
    nodesHealthy number
    (integer)
    parameters {[key: string]: string}
    (map[string]string: optional) An optional key-value map of strings passed directly to the CSI plugin to configure the volume.
    pluginId string
    (string: <required>) - The ID of the Nomad plugin for registering this volume.
    pluginProvider string
    (string)
    pluginProviderVersion string
    (string)
    schedulable boolean
    (boolean)
    secrets {[key: string]: string}
    (map[string]string: optional) An optional key-value map of strings used as credentials for publishing and unpublishing volumes.
    snapshotId string
    (string: <optional>) - The external ID of a snapshot to restore. If ommited, the volume will be created from scratch. Conflicts with clone_id.
    topologies ExternalVolumeTopology[]
    (List of topologies)
    topologyRequest ExternalVolumeTopologyRequest
    (``TopologyRequest``: <optional>) - Specify locations (region, zone, rack, etc.) where the provisioned volume is accessible from.
    type string
    (string: <required>) - The type of the volume. Currently, only csi is supported.
    volumeId string
    (string: <required>) - The unique ID of the volume.
    capabilities Sequence[ExternalVolumeCapabilityArgs]
    (``Capability``: <required>) - Options for validating the capability of a volume.
    capacity_max str
    (string: <optional>) - Option to signal a maximum volume size. This may not be supported by all storage providers.
    capacity_min str
    (string: <optional>) - Option to signal a minimum volume size. This may not be supported by all storage providers.
    clone_id str
    (string: <optional>) - The external ID of an existing volume to restore. If ommited, the volume will be created from scratch. Conflicts with snapshot_id.
    controller_required bool
    (boolean)
    controllers_expected int
    (integer)
    controllers_healthy int
    (integer)
    mount_options ExternalVolumeMountOptionsArgs
    (block: optional) Options for mounting block-device volumes without a pre-formatted file system.
    name str
    (string: <required>) - The display name for the volume.
    namespace str
    (string: "default") - The namespace in which to register the volume.
    nodes_expected int
    (integer)
    nodes_healthy int
    (integer)
    parameters Mapping[str, str]
    (map[string]string: optional) An optional key-value map of strings passed directly to the CSI plugin to configure the volume.
    plugin_id str
    (string: <required>) - The ID of the Nomad plugin for registering this volume.
    plugin_provider str
    (string)
    plugin_provider_version str
    (string)
    schedulable bool
    (boolean)
    secrets Mapping[str, str]
    (map[string]string: optional) An optional key-value map of strings used as credentials for publishing and unpublishing volumes.
    snapshot_id str
    (string: <optional>) - The external ID of a snapshot to restore. If ommited, the volume will be created from scratch. Conflicts with clone_id.
    topologies Sequence[ExternalVolumeTopologyArgs]
    (List of topologies)
    topology_request ExternalVolumeTopologyRequestArgs
    (``TopologyRequest``: <optional>) - Specify locations (region, zone, rack, etc.) where the provisioned volume is accessible from.
    type str
    (string: <required>) - The type of the volume. Currently, only csi is supported.
    volume_id str
    (string: <required>) - The unique ID of the volume.
    capabilities List<Property Map>
    (``Capability``: <required>) - Options for validating the capability of a volume.
    capacityMax String
    (string: <optional>) - Option to signal a maximum volume size. This may not be supported by all storage providers.
    capacityMin String
    (string: <optional>) - Option to signal a minimum volume size. This may not be supported by all storage providers.
    cloneId String
    (string: <optional>) - The external ID of an existing volume to restore. If ommited, the volume will be created from scratch. Conflicts with snapshot_id.
    controllerRequired Boolean
    (boolean)
    controllersExpected Number
    (integer)
    controllersHealthy Number
    (integer)
    mountOptions Property Map
    (block: optional) Options for mounting block-device volumes without a pre-formatted file system.
    name String
    (string: <required>) - The display name for the volume.
    namespace String
    (string: "default") - The namespace in which to register the volume.
    nodesExpected Number
    (integer)
    nodesHealthy Number
    (integer)
    parameters Map<String>
    (map[string]string: optional) An optional key-value map of strings passed directly to the CSI plugin to configure the volume.
    pluginId String
    (string: <required>) - The ID of the Nomad plugin for registering this volume.
    pluginProvider String
    (string)
    pluginProviderVersion String
    (string)
    schedulable Boolean
    (boolean)
    secrets Map<String>
    (map[string]string: optional) An optional key-value map of strings used as credentials for publishing and unpublishing volumes.
    snapshotId String
    (string: <optional>) - The external ID of a snapshot to restore. If ommited, the volume will be created from scratch. Conflicts with clone_id.
    topologies List<Property Map>
    (List of topologies)
    topologyRequest Property Map
    (``TopologyRequest``: <optional>) - Specify locations (region, zone, rack, etc.) where the provisioned volume is accessible from.
    type String
    (string: <required>) - The type of the volume. Currently, only csi is supported.
    volumeId String
    (string: <required>) - The unique ID of the volume.

    Supporting Types

    ExternalVolumeCapability, ExternalVolumeCapabilityArgs

    AccessMode string
    (string: <required>) - 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
    AttachmentMode string
    (string: <required>) - The storage API that will be used by the volume. Possible values are:

    • block-device
    • file-system
    AccessMode string
    (string: <required>) - 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
    AttachmentMode string
    (string: <required>) - The storage API that will be used by the volume. Possible values are:

    • block-device
    • file-system
    accessMode String
    (string: <required>) - 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
    attachmentMode String
    (string: <required>) - The storage API that will be used by the volume. Possible values are:

    • block-device
    • file-system
    accessMode string
    (string: <required>) - 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
    attachmentMode string
    (string: <required>) - The storage API that will be used by the volume. Possible values are:

    • block-device
    • file-system
    access_mode str
    (string: <required>) - 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
    attachment_mode str
    (string: <required>) - The storage API that will be used by the volume. Possible values are:

    • block-device
    • file-system
    accessMode String
    (string: <required>) - 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
    attachmentMode String
    (string: <required>) - The storage API that will be used by the volume. Possible values are:

    • block-device
    • file-system

    ExternalVolumeMountOptions, ExternalVolumeMountOptionsArgs

    FsType string
    (string: optional) - The file system type.
    MountFlags List<string>
    []string: optional - The flags passed to mount.
    FsType string
    (string: optional) - The file system type.
    MountFlags []string
    []string: optional - The flags passed to mount.
    fsType String
    (string: optional) - The file system type.
    mountFlags List<String>
    []string: optional - The flags passed to mount.
    fsType string
    (string: optional) - The file system type.
    mountFlags string[]
    []string: optional - The flags passed to mount.
    fs_type str
    (string: optional) - The file system type.
    mount_flags Sequence[str]
    []string: optional - The flags passed to mount.
    fsType String
    (string: optional) - The file system type.
    mountFlags List<String>
    []string: optional - The flags passed to mount.

    ExternalVolumeTopology, ExternalVolumeTopologyArgs

    Segments Dictionary<string, string>

    (map[string]string) - Define the attributes for the topology request.

    In addition to the above arguments, the following attributes are exported and can be referenced:

    Segments map[string]string

    (map[string]string) - Define the attributes for the topology request.

    In addition to the above arguments, the following attributes are exported and can be referenced:

    segments Map<String,String>

    (map[string]string) - Define the attributes for the topology request.

    In addition to the above arguments, the following attributes are exported and can be referenced:

    segments {[key: string]: string}

    (map[string]string) - Define the attributes for the topology request.

    In addition to the above arguments, the following attributes are exported and can be referenced:

    segments Mapping[str, str]

    (map[string]string) - Define the attributes for the topology request.

    In addition to the above arguments, the following attributes are exported and can be referenced:

    segments Map<String>

    (map[string]string) - Define the attributes for the topology request.

    In addition to the above arguments, the following attributes are exported and can be referenced:

    ExternalVolumeTopologyRequest, ExternalVolumeTopologyRequestArgs

    Preferred ExternalVolumeTopologyRequestPreferred
    (``Topology``: <optional>) - Preferred topologies indicate that the volume should be created in a location accessible from some of the listed topologies.
    Required ExternalVolumeTopologyRequestRequired
    (``Topology``: <optional>) - Required topologies indicate that the volume must be created in a location accessible from all the listed topologies.
    Preferred ExternalVolumeTopologyRequestPreferred
    (``Topology``: <optional>) - Preferred topologies indicate that the volume should be created in a location accessible from some of the listed topologies.
    Required ExternalVolumeTopologyRequestRequired
    (``Topology``: <optional>) - Required topologies indicate that the volume must be created in a location accessible from all the listed topologies.
    preferred ExternalVolumeTopologyRequestPreferred
    (``Topology``: <optional>) - Preferred topologies indicate that the volume should be created in a location accessible from some of the listed topologies.
    required ExternalVolumeTopologyRequestRequired
    (``Topology``: <optional>) - Required topologies indicate that the volume must be created in a location accessible from all the listed topologies.
    preferred ExternalVolumeTopologyRequestPreferred
    (``Topology``: <optional>) - Preferred topologies indicate that the volume should be created in a location accessible from some of the listed topologies.
    required ExternalVolumeTopologyRequestRequired
    (``Topology``: <optional>) - Required topologies indicate that the volume must be created in a location accessible from all the listed topologies.
    preferred ExternalVolumeTopologyRequestPreferred
    (``Topology``: <optional>) - Preferred topologies indicate that the volume should be created in a location accessible from some of the listed topologies.
    required ExternalVolumeTopologyRequestRequired
    (``Topology``: <optional>) - Required topologies indicate that the volume must be created in a location accessible from all the listed topologies.
    preferred Property Map
    (``Topology``: <optional>) - Preferred topologies indicate that the volume should be created in a location accessible from some of the listed topologies.
    required Property Map
    (``Topology``: <optional>) - Required topologies indicate that the volume must be created in a location accessible from all the listed topologies.

    ExternalVolumeTopologyRequestPreferred, ExternalVolumeTopologyRequestPreferredArgs

    Topologies List<ExternalVolumeTopologyRequestPreferredTopology>
    (List of segments: <required>) - Defines the location for the volume.
    Topologies []ExternalVolumeTopologyRequestPreferredTopology
    (List of segments: <required>) - Defines the location for the volume.
    topologies List<ExternalVolumeTopologyRequestPreferredTopology>
    (List of segments: <required>) - Defines the location for the volume.
    topologies ExternalVolumeTopologyRequestPreferredTopology[]
    (List of segments: <required>) - Defines the location for the volume.
    topologies Sequence[ExternalVolumeTopologyRequestPreferredTopology]
    (List of segments: <required>) - Defines the location for the volume.
    topologies List<Property Map>
    (List of segments: <required>) - Defines the location for the volume.

    ExternalVolumeTopologyRequestPreferredTopology, ExternalVolumeTopologyRequestPreferredTopologyArgs

    Segments Dictionary<string, string>

    (map[string]string) - Define the attributes for the topology request.

    In addition to the above arguments, the following attributes are exported and can be referenced:

    Segments map[string]string

    (map[string]string) - Define the attributes for the topology request.

    In addition to the above arguments, the following attributes are exported and can be referenced:

    segments Map<String,String>

    (map[string]string) - Define the attributes for the topology request.

    In addition to the above arguments, the following attributes are exported and can be referenced:

    segments {[key: string]: string}

    (map[string]string) - Define the attributes for the topology request.

    In addition to the above arguments, the following attributes are exported and can be referenced:

    segments Mapping[str, str]

    (map[string]string) - Define the attributes for the topology request.

    In addition to the above arguments, the following attributes are exported and can be referenced:

    segments Map<String>

    (map[string]string) - Define the attributes for the topology request.

    In addition to the above arguments, the following attributes are exported and can be referenced:

    ExternalVolumeTopologyRequestRequired, ExternalVolumeTopologyRequestRequiredArgs

    Topologies List<ExternalVolumeTopologyRequestRequiredTopology>
    (List of segments: <required>) - Defines the location for the volume.
    Topologies []ExternalVolumeTopologyRequestRequiredTopology
    (List of segments: <required>) - Defines the location for the volume.
    topologies List<ExternalVolumeTopologyRequestRequiredTopology>
    (List of segments: <required>) - Defines the location for the volume.
    topologies ExternalVolumeTopologyRequestRequiredTopology[]
    (List of segments: <required>) - Defines the location for the volume.
    topologies Sequence[ExternalVolumeTopologyRequestRequiredTopology]
    (List of segments: <required>) - Defines the location for the volume.
    topologies List<Property Map>
    (List of segments: <required>) - Defines the location for the volume.

    ExternalVolumeTopologyRequestRequiredTopology, ExternalVolumeTopologyRequestRequiredTopologyArgs

    Segments Dictionary<string, string>

    (map[string]string) - Define the attributes for the topology request.

    In addition to the above arguments, the following attributes are exported and can be referenced:

    Segments map[string]string

    (map[string]string) - Define the attributes for the topology request.

    In addition to the above arguments, the following attributes are exported and can be referenced:

    segments Map<String,String>

    (map[string]string) - Define the attributes for the topology request.

    In addition to the above arguments, the following attributes are exported and can be referenced:

    segments {[key: string]: string}

    (map[string]string) - Define the attributes for the topology request.

    In addition to the above arguments, the following attributes are exported and can be referenced:

    segments Mapping[str, str]

    (map[string]string) - Define the attributes for the topology request.

    In addition to the above arguments, the following attributes are exported and can be referenced:

    segments Map<String>

    (map[string]string) - Define the attributes for the topology request.

    In addition to the above arguments, the following attributes are exported and can be referenced:

    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.2.0 published on Wednesday, Mar 13, 2024 by Pulumi