HashiCorp Nomad

v0.2.1 published on Tuesday, Dec 7, 2021 by Pulumi

Namespace

Provisions a namespace within a Nomad cluster.

Nomad auto-generates a default namespace called default. This namespace cannot be removed, so destroying a nomad.Namespace resource where name = "default" will cause the namespace to be reset to its default configuration.

Example Usage

using Pulumi;
using Nomad = Pulumi.Nomad;

class MyStack : Stack
{
    public MyStack()
    {
        var dev = new Nomad.Namespace("dev", new Nomad.NamespaceArgs
        {
            Description = "Shared development environment.",
            Quota = "dev",
        });
    }

}
package main

import (
	"github.com/pulumi/pulumi-nomad/sdk/go/nomad"
	"github.com/pulumi/pulumi/sdk/v3/go/pulumi"
)

func main() {
	pulumi.Run(func(ctx *pulumi.Context) error {
		_, err := nomad.NewNamespace(ctx, "dev", &nomad.NamespaceArgs{
			Description: pulumi.String("Shared development environment."),
			Quota:       pulumi.String("dev"),
		})
		if err != nil {
			return err
		}
		return nil
	})
}
import pulumi
import pulumi_nomad as nomad

dev = nomad.Namespace("dev",
    description="Shared development environment.",
    quota="dev")
import * as pulumi from "@pulumi/pulumi";
import * as nomad from "@pulumi/nomad";

const dev = new nomad.Namespace("dev", {
    description: "Shared development environment.",
    quota: "dev",
});

Create a Namespace Resource

new Namespace(name: string, args?: NamespaceArgs, opts?: CustomResourceOptions);
@overload
def Namespace(resource_name: str,
              opts: Optional[ResourceOptions] = None,
              description: Optional[str] = None,
              name: Optional[str] = None,
              quota: Optional[str] = None)
@overload
def Namespace(resource_name: str,
              args: Optional[NamespaceArgs] = None,
              opts: Optional[ResourceOptions] = None)
func NewNamespace(ctx *Context, name string, args *NamespaceArgs, opts ...ResourceOption) (*Namespace, error)
public Namespace(string name, NamespaceArgs? args = null, CustomResourceOptions? opts = null)
name string
The unique name of the resource.
args NamespaceArgs
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 NamespaceArgs
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 NamespaceArgs
The arguments to resource properties.
opts ResourceOption
Bag of options to control resource's behavior.
name string
The unique name of the resource.
args NamespaceArgs
The arguments to resource properties.
opts CustomResourceOptions
Bag of options to control resource's behavior.

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

Description string
(string: "") - A description of the namespace.
Name string
(string: <required>) - A unique name for the namespace.
Quota string
(string: "") - A resource quota to attach to the namespace.
Description string
(string: "") - A description of the namespace.
Name string
(string: <required>) - A unique name for the namespace.
Quota string
(string: "") - A resource quota to attach to the namespace.
description string
(string: "") - A description of the namespace.
name string
(string: <required>) - A unique name for the namespace.
quota string
(string: "") - A resource quota to attach to the namespace.
description str
(string: "") - A description of the namespace.
name str
(string: <required>) - A unique name for the namespace.
quota str
(string: "") - A resource quota to attach to the namespace.

Outputs

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

Id string
The provider-assigned unique ID for this managed resource.
Id string
The provider-assigned unique ID for this managed resource.
id string
The provider-assigned unique ID for this managed resource.
id str
The provider-assigned unique ID for this managed resource.

Look up an Existing Namespace Resource

Get an existing Namespace 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?: NamespaceState, opts?: CustomResourceOptions): Namespace
@staticmethod
def get(resource_name: str,
        id: str,
        opts: Optional[ResourceOptions] = None,
        description: Optional[str] = None,
        name: Optional[str] = None,
        quota: Optional[str] = None) -> Namespace
func GetNamespace(ctx *Context, name string, id IDInput, state *NamespaceState, opts ...ResourceOption) (*Namespace, error)
public static Namespace Get(string name, Input<string> id, NamespaceState? state, CustomResourceOptions? opts = null)
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.

The following state arguments are supported:

Description string
(string: "") - A description of the namespace.
Name string
(string: <required>) - A unique name for the namespace.
Quota string
(string: "") - A resource quota to attach to the namespace.
Description string
(string: "") - A description of the namespace.
Name string
(string: <required>) - A unique name for the namespace.
Quota string
(string: "") - A resource quota to attach to the namespace.
description string
(string: "") - A description of the namespace.
name string
(string: <required>) - A unique name for the namespace.
quota string
(string: "") - A resource quota to attach to the namespace.
description str
(string: "") - A description of the namespace.
name str
(string: <required>) - A unique name for the namespace.
quota str
(string: "") - A resource quota to attach to the namespace.

Package Details

Repository
https://github.com/pulumi/pulumi-nomad
License
Apache-2.0
Notes
This Pulumi package is based on the nomad Terraform Provider.