UNPKG

@pulumi/vault

Version:

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

131 lines 4.97 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.Endpoint = void 0; const pulumi = require("@pulumi/pulumi"); const utilities = require("../utilities"); /** * ## Example Usage * * ```typescript * import * as pulumi from "@pulumi/pulumi"; * import * as vault from "@pulumi/vault"; * * const userpass = new vault.AuthBackend("userpass", {type: "userpass"}); * const u1 = new vault.generic.Endpoint("u1", { * path: "auth/userpass/users/u1", * ignoreAbsentFields: true, * dataJson: `{ * "policies": ["p1"], * "password": "changeme" * } * `, * }, { * dependsOn: [userpass], * }); * const u1Token = new vault.generic.Endpoint("u1_token", { * path: "auth/userpass/login/u1", * disableRead: true, * disableDelete: true, * dataJson: `{ * "password": "changeme" * } * `, * }, { * dependsOn: [u1], * }); * const u1Entity = new vault.generic.Endpoint("u1_entity", { * disableRead: true, * disableDelete: true, * path: "identity/lookup/entity", * ignoreAbsentFields: true, * writeFields: ["id"], * dataJson: `{ * "alias_name": "u1", * "alias_mount_accessor": vault_auth_backend.userpass.accessor * } * `, * }, { * dependsOn: [u1Token], * }); * export const u1Id = u1Entity.writeData.id; * ``` * * ## Required Vault Capabilities * * Use of this resource requires the `create` or `update` capability * (depending on whether the resource already exists) on the given path. If * `disableDelete` is false, the `delete` capability is also required. If * `disableRead` is false, the `read` capability is required. * * ## Import * * Import is not supported for this resource. */ class Endpoint extends pulumi.CustomResource { /** * Get an existing Endpoint 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 Endpoint(name, state, { ...opts, id: id }); } /** * Returns true if the given object is an instance of Endpoint. 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'] === Endpoint.__pulumiType; } constructor(name, argsOrState, opts) { let resourceInputs = {}; opts = opts || {}; if (opts.id) { const state = argsOrState; resourceInputs["dataJson"] = state?.dataJson; resourceInputs["disableDelete"] = state?.disableDelete; resourceInputs["disableRead"] = state?.disableRead; resourceInputs["ignoreAbsentFields"] = state?.ignoreAbsentFields; resourceInputs["namespace"] = state?.namespace; resourceInputs["path"] = state?.path; resourceInputs["writeData"] = state?.writeData; resourceInputs["writeDataJson"] = state?.writeDataJson; resourceInputs["writeFields"] = state?.writeFields; } else { const args = argsOrState; if (args?.dataJson === undefined && !opts.urn) { throw new Error("Missing required property 'dataJson'"); } if (args?.path === undefined && !opts.urn) { throw new Error("Missing required property 'path'"); } resourceInputs["dataJson"] = args?.dataJson ? pulumi.secret(args.dataJson) : undefined; resourceInputs["disableDelete"] = args?.disableDelete; resourceInputs["disableRead"] = args?.disableRead; resourceInputs["ignoreAbsentFields"] = args?.ignoreAbsentFields; resourceInputs["namespace"] = args?.namespace; resourceInputs["path"] = args?.path; resourceInputs["writeFields"] = args?.writeFields; resourceInputs["writeData"] = undefined /*out*/; resourceInputs["writeDataJson"] = undefined /*out*/; } opts = pulumi.mergeOptions(utilities.resourceOptsDefaults(), opts); const secretOpts = { additionalSecretOutputs: ["dataJson"] }; opts = pulumi.mergeOptions(opts, secretOpts); super(Endpoint.__pulumiType, name, resourceInputs, opts); } } exports.Endpoint = Endpoint; /** @internal */ Endpoint.__pulumiType = 'vault:generic/endpoint:Endpoint'; //# sourceMappingURL=endpoint.js.map