1. Packages
  2. Packages
  3. Nomad Provider
  4. API Docs
  5. getNamespace
Viewing docs for Nomad v2.6.1
published on Tuesday, Apr 21, 2026 by Pulumi
nomad logo
Viewing docs for Nomad v2.6.1
published on Tuesday, Apr 21, 2026 by Pulumi

    Get information about a namespace in Nomad.

    Example Usage

    import * as pulumi from "@pulumi/pulumi";
    import * as nomad from "@pulumi/nomad";
    
    const namespaces = nomad.getNamespace({
        name: "default",
    });
    
    import pulumi
    import pulumi_nomad as nomad
    
    namespaces = nomad.get_namespace(name="default")
    
    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 {
    		_, err := nomad.GetNamespace(ctx, &nomad.LookupNamespaceArgs{
    			Name: "default",
    		}, nil)
    		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 namespaces = Nomad.Index.GetNamespace.Invoke(new()
        {
            Name = "default",
        });
    
    });
    
    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.GetNamespaceArgs;
    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 namespaces = NomadFunctions.getNamespace(GetNamespaceArgs.builder()
                .name("default")
                .build());
    
        }
    }
    
    variables:
      namespaces:
        fn::invoke:
          function: nomad:getNamespace
          arguments:
            name: default
    

    Using getNamespace

    Two invocation forms are available. The direct form accepts plain arguments and either blocks until the result value is available, or returns a Promise-wrapped result. The output form accepts Input-wrapped arguments and returns an Output-wrapped result.

    function getNamespace(args: GetNamespaceArgs, opts?: InvokeOptions): Promise<GetNamespaceResult>
    function getNamespaceOutput(args: GetNamespaceOutputArgs, opts?: InvokeOptions): Output<GetNamespaceResult>
    def get_namespace(name: Optional[str] = None,
                      opts: Optional[InvokeOptions] = None) -> GetNamespaceResult
    def get_namespace_output(name: pulumi.Input[Optional[str]] = None,
                      opts: Optional[InvokeOptions] = None) -> Output[GetNamespaceResult]
    func LookupNamespace(ctx *Context, args *LookupNamespaceArgs, opts ...InvokeOption) (*LookupNamespaceResult, error)
    func LookupNamespaceOutput(ctx *Context, args *LookupNamespaceOutputArgs, opts ...InvokeOption) LookupNamespaceResultOutput

    > Note: This function is named LookupNamespace in the Go SDK.

    public static class GetNamespace 
    {
        public static Task<GetNamespaceResult> InvokeAsync(GetNamespaceArgs args, InvokeOptions? opts = null)
        public static Output<GetNamespaceResult> Invoke(GetNamespaceInvokeArgs args, InvokeOptions? opts = null)
    }
    public static CompletableFuture<GetNamespaceResult> getNamespace(GetNamespaceArgs args, InvokeOptions options)
    public static Output<GetNamespaceResult> getNamespace(GetNamespaceArgs args, InvokeOptions options)
    
    fn::invoke:
      function: nomad:index/getNamespace:getNamespace
      arguments:
        # arguments dictionary

    The following arguments are supported:

    Name string
    (string) - The name of the namespace.
    Name string
    (string) - The name of the namespace.
    name String
    (string) - The name of the namespace.
    name string
    (string) - The name of the namespace.
    name str
    (string) - The name of the namespace.
    name String
    (string) - The name of the namespace.

    getNamespace Result

    The following output properties are available:

    Capabilities List<GetNamespaceCapability>
    (block) - Capabilities of the namespace
    ConsulConfigs List<GetNamespaceConsulConfig>
    (block) - Consul configuration for the namespace.
    Description string
    (string) - The description of the namespace.
    Id string
    The provider-assigned unique ID for this managed resource.
    Meta Dictionary<string, string>
    (map[string]string) - Arbitrary KV metadata associated with the namespace.
    Name string
    NodePoolConfigs List<GetNamespaceNodePoolConfig>
    (block) - Node pool configuration for the namespace.
    Quota string
    (string) - The quota associated with the namespace.
    VaultConfigs List<GetNamespaceVaultConfig>
    (block) - Vault configuration for the namespace.
    Capabilities []GetNamespaceCapability
    (block) - Capabilities of the namespace
    ConsulConfigs []GetNamespaceConsulConfig
    (block) - Consul configuration for the namespace.
    Description string
    (string) - The description of the namespace.
    Id string
    The provider-assigned unique ID for this managed resource.
    Meta map[string]string
    (map[string]string) - Arbitrary KV metadata associated with the namespace.
    Name string
    NodePoolConfigs []GetNamespaceNodePoolConfig
    (block) - Node pool configuration for the namespace.
    Quota string
    (string) - The quota associated with the namespace.
    VaultConfigs []GetNamespaceVaultConfig
    (block) - Vault configuration for the namespace.
    capabilities List<GetNamespaceCapability>
    (block) - Capabilities of the namespace
    consulConfigs List<GetNamespaceConsulConfig>
    (block) - Consul configuration for the namespace.
    description String
    (string) - The description of the namespace.
    id String
    The provider-assigned unique ID for this managed resource.
    meta Map<String,String>
    (map[string]string) - Arbitrary KV metadata associated with the namespace.
    name String
    nodePoolConfigs List<GetNamespaceNodePoolConfig>
    (block) - Node pool configuration for the namespace.
    quota String
    (string) - The quota associated with the namespace.
    vaultConfigs List<GetNamespaceVaultConfig>
    (block) - Vault configuration for the namespace.
    capabilities GetNamespaceCapability[]
    (block) - Capabilities of the namespace
    consulConfigs GetNamespaceConsulConfig[]
    (block) - Consul configuration for the namespace.
    description string
    (string) - The description of the namespace.
    id string
    The provider-assigned unique ID for this managed resource.
    meta {[key: string]: string}
    (map[string]string) - Arbitrary KV metadata associated with the namespace.
    name string
    nodePoolConfigs GetNamespaceNodePoolConfig[]
    (block) - Node pool configuration for the namespace.
    quota string
    (string) - The quota associated with the namespace.
    vaultConfigs GetNamespaceVaultConfig[]
    (block) - Vault configuration for the namespace.
    capabilities Sequence[GetNamespaceCapability]
    (block) - Capabilities of the namespace
    consul_configs Sequence[GetNamespaceConsulConfig]
    (block) - Consul configuration for the namespace.
    description str
    (string) - The description of the namespace.
    id str
    The provider-assigned unique ID for this managed resource.
    meta Mapping[str, str]
    (map[string]string) - Arbitrary KV metadata associated with the namespace.
    name str
    node_pool_configs Sequence[GetNamespaceNodePoolConfig]
    (block) - Node pool configuration for the namespace.
    quota str
    (string) - The quota associated with the namespace.
    vault_configs Sequence[GetNamespaceVaultConfig]
    (block) - Vault configuration for the namespace.
    capabilities List<Property Map>
    (block) - Capabilities of the namespace
    consulConfigs List<Property Map>
    (block) - Consul configuration for the namespace.
    description String
    (string) - The description of the namespace.
    id String
    The provider-assigned unique ID for this managed resource.
    meta Map<String>
    (map[string]string) - Arbitrary KV metadata associated with the namespace.
    name String
    nodePoolConfigs List<Property Map>
    (block) - Node pool configuration for the namespace.
    quota String
    (string) - The quota associated with the namespace.
    vaultConfigs List<Property Map>
    (block) - Vault configuration for the namespace.

    Supporting Types

    GetNamespaceCapability

    DisabledNetworkModes List<string>
    ([]string) - Network modes disabled for the namespace.
    DisabledTaskDrivers List<string>
    ([]string) - Task drivers disabled for the namespace.
    EnabledNetworkModes List<string>
    ([]string) - Network modes enabled for the namespace.
    EnabledTaskDrivers List<string>
    ([]string) - Task drivers enabled for the namespace.
    DisabledNetworkModes []string
    ([]string) - Network modes disabled for the namespace.
    DisabledTaskDrivers []string
    ([]string) - Task drivers disabled for the namespace.
    EnabledNetworkModes []string
    ([]string) - Network modes enabled for the namespace.
    EnabledTaskDrivers []string
    ([]string) - Task drivers enabled for the namespace.
    disabledNetworkModes List<String>
    ([]string) - Network modes disabled for the namespace.
    disabledTaskDrivers List<String>
    ([]string) - Task drivers disabled for the namespace.
    enabledNetworkModes List<String>
    ([]string) - Network modes enabled for the namespace.
    enabledTaskDrivers List<String>
    ([]string) - Task drivers enabled for the namespace.
    disabledNetworkModes string[]
    ([]string) - Network modes disabled for the namespace.
    disabledTaskDrivers string[]
    ([]string) - Task drivers disabled for the namespace.
    enabledNetworkModes string[]
    ([]string) - Network modes enabled for the namespace.
    enabledTaskDrivers string[]
    ([]string) - Task drivers enabled for the namespace.
    disabled_network_modes Sequence[str]
    ([]string) - Network modes disabled for the namespace.
    disabled_task_drivers Sequence[str]
    ([]string) - Task drivers disabled for the namespace.
    enabled_network_modes Sequence[str]
    ([]string) - Network modes enabled for the namespace.
    enabled_task_drivers Sequence[str]
    ([]string) - Task drivers enabled for the namespace.
    disabledNetworkModes List<String>
    ([]string) - Network modes disabled for the namespace.
    disabledTaskDrivers List<String>
    ([]string) - Task drivers disabled for the namespace.
    enabledNetworkModes List<String>
    ([]string) - Network modes enabled for the namespace.
    enabledTaskDrivers List<String>
    ([]string) - Task drivers enabled for the namespace.

    GetNamespaceConsulConfig

    Alloweds List<string>
    ([]string) - The list of Consul clusters allowed to be used in this namespace.
    Default string
    (string) - The Consul cluster to use when none is specified in the job.
    Denieds List<string>
    ([]string) - The list of Consul clusters not allowed to be used in this namespace.
    Alloweds []string
    ([]string) - The list of Consul clusters allowed to be used in this namespace.
    Default string
    (string) - The Consul cluster to use when none is specified in the job.
    Denieds []string
    ([]string) - The list of Consul clusters not allowed to be used in this namespace.
    alloweds List<String>
    ([]string) - The list of Consul clusters allowed to be used in this namespace.
    default_ String
    (string) - The Consul cluster to use when none is specified in the job.
    denieds List<String>
    ([]string) - The list of Consul clusters not allowed to be used in this namespace.
    alloweds string[]
    ([]string) - The list of Consul clusters allowed to be used in this namespace.
    default string
    (string) - The Consul cluster to use when none is specified in the job.
    denieds string[]
    ([]string) - The list of Consul clusters not allowed to be used in this namespace.
    alloweds Sequence[str]
    ([]string) - The list of Consul clusters allowed to be used in this namespace.
    default str
    (string) - The Consul cluster to use when none is specified in the job.
    denieds Sequence[str]
    ([]string) - The list of Consul clusters not allowed to be used in this namespace.
    alloweds List<String>
    ([]string) - The list of Consul clusters allowed to be used in this namespace.
    default String
    (string) - The Consul cluster to use when none is specified in the job.
    denieds List<String>
    ([]string) - The list of Consul clusters not allowed to be used in this namespace.

    GetNamespaceNodePoolConfig

    Alloweds List<string>
    ([]string) - The list of Consul clusters allowed to be used in this namespace.
    Default string
    (string) - The Consul cluster to use when none is specified in the job.
    Denieds List<string>
    ([]string) - The list of Consul clusters not allowed to be used in this namespace.
    Alloweds []string
    ([]string) - The list of Consul clusters allowed to be used in this namespace.
    Default string
    (string) - The Consul cluster to use when none is specified in the job.
    Denieds []string
    ([]string) - The list of Consul clusters not allowed to be used in this namespace.
    alloweds List<String>
    ([]string) - The list of Consul clusters allowed to be used in this namespace.
    default_ String
    (string) - The Consul cluster to use when none is specified in the job.
    denieds List<String>
    ([]string) - The list of Consul clusters not allowed to be used in this namespace.
    alloweds string[]
    ([]string) - The list of Consul clusters allowed to be used in this namespace.
    default string
    (string) - The Consul cluster to use when none is specified in the job.
    denieds string[]
    ([]string) - The list of Consul clusters not allowed to be used in this namespace.
    alloweds Sequence[str]
    ([]string) - The list of Consul clusters allowed to be used in this namespace.
    default str
    (string) - The Consul cluster to use when none is specified in the job.
    denieds Sequence[str]
    ([]string) - The list of Consul clusters not allowed to be used in this namespace.
    alloweds List<String>
    ([]string) - The list of Consul clusters allowed to be used in this namespace.
    default String
    (string) - The Consul cluster to use when none is specified in the job.
    denieds List<String>
    ([]string) - The list of Consul clusters not allowed to be used in this namespace.

    GetNamespaceVaultConfig

    Alloweds List<string>
    ([]string) - The list of Consul clusters allowed to be used in this namespace.
    Default string
    (string) - The Consul cluster to use when none is specified in the job.
    Denieds List<string>
    ([]string) - The list of Consul clusters not allowed to be used in this namespace.
    Alloweds []string
    ([]string) - The list of Consul clusters allowed to be used in this namespace.
    Default string
    (string) - The Consul cluster to use when none is specified in the job.
    Denieds []string
    ([]string) - The list of Consul clusters not allowed to be used in this namespace.
    alloweds List<String>
    ([]string) - The list of Consul clusters allowed to be used in this namespace.
    default_ String
    (string) - The Consul cluster to use when none is specified in the job.
    denieds List<String>
    ([]string) - The list of Consul clusters not allowed to be used in this namespace.
    alloweds string[]
    ([]string) - The list of Consul clusters allowed to be used in this namespace.
    default string
    (string) - The Consul cluster to use when none is specified in the job.
    denieds string[]
    ([]string) - The list of Consul clusters not allowed to be used in this namespace.
    alloweds Sequence[str]
    ([]string) - The list of Consul clusters allowed to be used in this namespace.
    default str
    (string) - The Consul cluster to use when none is specified in the job.
    denieds Sequence[str]
    ([]string) - The list of Consul clusters not allowed to be used in this namespace.
    alloweds List<String>
    ([]string) - The list of Consul clusters allowed to be used in this namespace.
    default String
    (string) - The Consul cluster to use when none is specified in the job.
    denieds List<String>
    ([]string) - The list of Consul clusters not allowed to be used in this namespace.

    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
    Viewing docs for Nomad v2.6.1
    published on Tuesday, Apr 21, 2026 by Pulumi
      Try Pulumi Cloud free. Your team will thank you.