UNPKG

@pulumi/vault

Version:

A Pulumi package for creating and managing HashiCorp Vault cloud resources.

111 lines 3.56 kB
"use strict"; // *** WARNING: this file was generated by pulumi-language-nodejs. *** // *** Do not edit by hand unless you're certain you know what you are doing! *** Object.defineProperty(exports, "__esModule", { value: true }); exports.Namespace = void 0; const pulumi = require("@pulumi/pulumi"); const utilities = require("./utilities"); /** * ## Import * * Namespaces can be imported using its `name` as accessor id * * ```sh * $ pulumi import vault:index/namespace:Namespace example <name> * ``` * * If the declared resource is imported and intends to support namespaces using a provider alias, then the name is relative to the namespace path. * * hcl * * provider "vault" { * * # Configuration options * * namespace = "example" * * alias = "example" * * } * * resource "vault_namespace" "example2" { * * provider = vault.example * * path = "example2" * * } * * ```sh * $ pulumi import vault:index/namespace:Namespace example2 example2 * ``` * * $ terraform state show vault_namespace.example2 * * vault_namespace.example2: * * resource "vault_namespace" "example2" { * * id = "example/example2/" * * namespace_id = <known after import> * * path = "example2" * * path_fq = "example2" * * } */ 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, id, state, opts) { return new Namespace(name, state, { ...opts, id: id }); } /** * 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) { if (obj === undefined || obj === null) { return false; } return obj['__pulumiType'] === Namespace.__pulumiType; } constructor(name, argsOrState, opts) { let resourceInputs = {}; opts = opts || {}; if (opts.id) { const state = argsOrState; resourceInputs["customMetadata"] = state?.customMetadata; resourceInputs["namespace"] = state?.namespace; resourceInputs["namespaceId"] = state?.namespaceId; resourceInputs["path"] = state?.path; resourceInputs["pathFq"] = state?.pathFq; } else { const args = argsOrState; if (args?.path === undefined && !opts.urn) { throw new Error("Missing required property 'path'"); } resourceInputs["customMetadata"] = args?.customMetadata; resourceInputs["namespace"] = args?.namespace; resourceInputs["path"] = args?.path; resourceInputs["pathFq"] = args?.pathFq; resourceInputs["namespaceId"] = undefined /*out*/; } opts = pulumi.mergeOptions(utilities.resourceOptsDefaults(), opts); super(Namespace.__pulumiType, name, resourceInputs, opts); } } exports.Namespace = Namespace; /** @internal */ Namespace.__pulumiType = 'vault:index/namespace:Namespace'; //# sourceMappingURL=namespace.js.map