@pulumi/vault
Version: 
A Pulumi package for creating and managing HashiCorp Vault cloud resources.
105 lines • 4.21 kB
JavaScript
;
// *** 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.Plugin = 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 jwt = new vault.Plugin("jwt", {
 *     type: "auth",
 *     name: "jwt",
 *     command: "vault-plugin-auth-jwt",
 *     version: "v0.17.0",
 *     sha256: "6bd0a803ed742aa3ce35e4fa23d2c8d550e6c1567bf63410cec489c28b68b0fc",
 *     envs: ["HTTP_PROXY=http://proxy.example.com:8080"],
 * });
 * const jwtAuth = new vault.AuthBackend("jwt_auth", {type: jwt.name});
 * ```
 *
 * ## Import
 *
 * Plugins can be imported using `:type/name/:name` or `:type/version/:version/name/:name` as the ID if the version is non-empty, e.g.
 *
 * ```sh
 * $ pulumi import vault:index/plugin:Plugin jwt auth/name/jwt
 * ```
 * ```sh
 * $ pulumi import vault:index/plugin:Plugin jwt auth/version/v0.17.0/name/jwt
 * ```
 */
class Plugin extends pulumi.CustomResource {
    /**
     * Get an existing Plugin 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 Plugin(name, state, { ...opts, id: id });
    }
    /**
     * Returns true if the given object is an instance of Plugin.  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'] === Plugin.__pulumiType;
    }
    constructor(name, argsOrState, opts) {
        let resourceInputs = {};
        opts = opts || {};
        if (opts.id) {
            const state = argsOrState;
            resourceInputs["args"] = state?.args;
            resourceInputs["command"] = state?.command;
            resourceInputs["envs"] = state?.envs;
            resourceInputs["name"] = state?.name;
            resourceInputs["ociImage"] = state?.ociImage;
            resourceInputs["runtime"] = state?.runtime;
            resourceInputs["sha256"] = state?.sha256;
            resourceInputs["type"] = state?.type;
            resourceInputs["version"] = state?.version;
        }
        else {
            const args = argsOrState;
            if (args?.command === undefined && !opts.urn) {
                throw new Error("Missing required property 'command'");
            }
            if (args?.sha256 === undefined && !opts.urn) {
                throw new Error("Missing required property 'sha256'");
            }
            if (args?.type === undefined && !opts.urn) {
                throw new Error("Missing required property 'type'");
            }
            resourceInputs["args"] = args?.args;
            resourceInputs["command"] = args?.command;
            resourceInputs["envs"] = args?.envs ? pulumi.secret(args.envs) : undefined;
            resourceInputs["name"] = args?.name;
            resourceInputs["ociImage"] = args?.ociImage;
            resourceInputs["runtime"] = args?.runtime;
            resourceInputs["sha256"] = args?.sha256;
            resourceInputs["type"] = args?.type;
            resourceInputs["version"] = args?.version;
        }
        opts = pulumi.mergeOptions(utilities.resourceOptsDefaults(), opts);
        const secretOpts = { additionalSecretOutputs: ["envs"] };
        opts = pulumi.mergeOptions(opts, secretOpts);
        super(Plugin.__pulumiType, name, resourceInputs, opts);
    }
}
exports.Plugin = Plugin;
/** @internal */
Plugin.__pulumiType = 'vault:index/plugin:Plugin';
//# sourceMappingURL=plugin.js.map