UNPKG

@pulumi/nomad

Version:

A Pulumi package for creating and managing nomad cloud resources.

171 lines (170 loc) 5.94 kB
import * as pulumi from "@pulumi/pulumi"; import * as inputs from "./types/input"; import * as outputs from "./types/output"; /** * 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 * * Registering a namespace: * * ```typescript * import * as pulumi from "@pulumi/pulumi"; * import * as nomad from "@pulumi/nomad"; * * const dev = new nomad.Namespace("dev", { * name: "dev", * description: "Shared development environment.", * quota: "dev", * meta: { * owner: "John Doe", * foo: "bar", * }, * }); * ``` * * Registering a namespace with a quota: * * ```typescript * import * as pulumi from "@pulumi/pulumi"; * import * as nomad from "@pulumi/nomad"; * * const webTeam = new nomad.QuoteSpecification("web_team", { * name: "web-team", * description: "web team quota", * limits: [{ * region: "global", * regionLimit: { * cpu: 1000, * memoryMb: 256, * }, * }], * }); * const web = new nomad.Namespace("web", { * name: "web", * description: "Web team production environment.", * quota: webTeam.name, * }); * ``` */ export declare class Namespace extends pulumi.CustomResource { /** * Get an existing Namespace resource's state with the given name, ID, and optional extra * properties used to qualify the lookup. * * @param name The _unique_ name of the resulting resource. * @param id The _unique_ provider ID of the resource to lookup. * @param state Any extra arguments used during the lookup. * @param opts Optional settings to control the behavior of the CustomResource. */ static get(name: string, id: pulumi.Input<pulumi.ID>, state?: NamespaceState, opts?: pulumi.CustomResourceOptions): Namespace; /** * Returns true if the given object is an instance of Namespace. This is designed to work even * when multiple copies of the Pulumi SDK have been loaded into the same process. */ static isInstance(obj: any): obj is Namespace; /** * `(block: <optional>)` - A block of capabilities for the namespace. Can't * be repeated. See below for the structure of this block. */ readonly capabilities: pulumi.Output<outputs.NamespaceCapabilities | undefined>; /** * `(string: "")` - A description of the namespace. */ readonly description: pulumi.Output<string | undefined>; /** * `(map[string]string: <optional>)` - Specifies arbitrary KV metadata to associate with the namespace. */ readonly meta: pulumi.Output<{ [key: string]: string; } | undefined>; /** * `(string: <required>)` - A unique name for the namespace. */ readonly name: pulumi.Output<string>; /** * `(block: <optional>)` - A block with node pool configuration for the namespace (Nomad Enterprise only). */ readonly nodePoolConfig: pulumi.Output<outputs.NamespaceNodePoolConfig>; /** * `(string: "")` - A resource quota to attach to the namespace. */ readonly quota: pulumi.Output<string | undefined>; /** * Create a Namespace resource with the given unique name, arguments, and options. * * @param name The _unique_ name of the resource. * @param args The arguments to use to populate this resource's properties. * @param opts A bag of options that control this resource's behavior. */ constructor(name: string, args?: NamespaceArgs, opts?: pulumi.CustomResourceOptions); } /** * Input properties used for looking up and filtering Namespace resources. */ export interface NamespaceState { /** * `(block: <optional>)` - A block of capabilities for the namespace. Can't * be repeated. See below for the structure of this block. */ capabilities?: pulumi.Input<inputs.NamespaceCapabilities>; /** * `(string: "")` - A description of the namespace. */ description?: pulumi.Input<string>; /** * `(map[string]string: <optional>)` - Specifies arbitrary KV metadata to associate with the namespace. */ meta?: pulumi.Input<{ [key: string]: pulumi.Input<string>; }>; /** * `(string: <required>)` - A unique name for the namespace. */ name?: pulumi.Input<string>; /** * `(block: <optional>)` - A block with node pool configuration for the namespace (Nomad Enterprise only). */ nodePoolConfig?: pulumi.Input<inputs.NamespaceNodePoolConfig>; /** * `(string: "")` - A resource quota to attach to the namespace. */ quota?: pulumi.Input<string>; } /** * The set of arguments for constructing a Namespace resource. */ export interface NamespaceArgs { /** * `(block: <optional>)` - A block of capabilities for the namespace. Can't * be repeated. See below for the structure of this block. */ capabilities?: pulumi.Input<inputs.NamespaceCapabilities>; /** * `(string: "")` - A description of the namespace. */ description?: pulumi.Input<string>; /** * `(map[string]string: <optional>)` - Specifies arbitrary KV metadata to associate with the namespace. */ meta?: pulumi.Input<{ [key: string]: pulumi.Input<string>; }>; /** * `(string: <required>)` - A unique name for the namespace. */ name?: pulumi.Input<string>; /** * `(block: <optional>)` - A block with node pool configuration for the namespace (Nomad Enterprise only). */ nodePoolConfig?: pulumi.Input<inputs.NamespaceNodePoolConfig>; /** * `(string: "")` - A resource quota to attach to the namespace. */ quota?: pulumi.Input<string>; }