@pulumi/vault
Version: 
A Pulumi package for creating and managing HashiCorp Vault cloud resources.
109 lines • 4.54 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.MfaDuo = void 0;
const pulumi = require("@pulumi/pulumi");
const utilities = require("./utilities");
/**
 * Provides a resource to manage [Duo MFA](https://www.vaultproject.io/docs/enterprise/mfa/mfa-duo.html).
 *
 * **Note** this feature is available only with Vault Enterprise.
 *
 * ## Example Usage
 *
 * ```typescript
 * import * as pulumi from "@pulumi/pulumi";
 * import * as vault from "@pulumi/vault";
 *
 * const userpass = new vault.AuthBackend("userpass", {
 *     type: "userpass",
 *     path: "userpass",
 * });
 * const myDuo = new vault.MfaDuo("my_duo", {
 *     name: "my_duo",
 *     mountAccessor: userpass.accessor,
 *     secretKey: "8C7THtrIigh2rPZQMbguugt8IUftWhMRCOBzbuyz",
 *     integrationKey: "BIACEUEAXI20BNWTEYXT",
 *     apiHostname: "api-2b5c39f5.duosecurity.com",
 * });
 * ```
 *
 * ## Import
 *
 * Mounts can be imported using the `path`, e.g.
 *
 * ```sh
 * $ pulumi import vault:index/mfaDuo:MfaDuo my_duo my_duo
 * ```
 */
class MfaDuo extends pulumi.CustomResource {
    /**
     * Get an existing MfaDuo 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 MfaDuo(name, state, { ...opts, id: id });
    }
    /**
     * Returns true if the given object is an instance of MfaDuo.  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'] === MfaDuo.__pulumiType;
    }
    constructor(name, argsOrState, opts) {
        let resourceInputs = {};
        opts = opts || {};
        if (opts.id) {
            const state = argsOrState;
            resourceInputs["apiHostname"] = state?.apiHostname;
            resourceInputs["integrationKey"] = state?.integrationKey;
            resourceInputs["mountAccessor"] = state?.mountAccessor;
            resourceInputs["name"] = state?.name;
            resourceInputs["namespace"] = state?.namespace;
            resourceInputs["pushInfo"] = state?.pushInfo;
            resourceInputs["secretKey"] = state?.secretKey;
            resourceInputs["usernameFormat"] = state?.usernameFormat;
        }
        else {
            const args = argsOrState;
            if (args?.apiHostname === undefined && !opts.urn) {
                throw new Error("Missing required property 'apiHostname'");
            }
            if (args?.integrationKey === undefined && !opts.urn) {
                throw new Error("Missing required property 'integrationKey'");
            }
            if (args?.mountAccessor === undefined && !opts.urn) {
                throw new Error("Missing required property 'mountAccessor'");
            }
            if (args?.secretKey === undefined && !opts.urn) {
                throw new Error("Missing required property 'secretKey'");
            }
            resourceInputs["apiHostname"] = args?.apiHostname;
            resourceInputs["integrationKey"] = args?.integrationKey ? pulumi.secret(args.integrationKey) : undefined;
            resourceInputs["mountAccessor"] = args?.mountAccessor;
            resourceInputs["name"] = args?.name;
            resourceInputs["namespace"] = args?.namespace;
            resourceInputs["pushInfo"] = args?.pushInfo;
            resourceInputs["secretKey"] = args?.secretKey ? pulumi.secret(args.secretKey) : undefined;
            resourceInputs["usernameFormat"] = args?.usernameFormat;
        }
        opts = pulumi.mergeOptions(utilities.resourceOptsDefaults(), opts);
        const secretOpts = { additionalSecretOutputs: ["integrationKey", "secretKey"] };
        opts = pulumi.mergeOptions(opts, secretOpts);
        super(MfaDuo.__pulumiType, name, resourceInputs, opts);
    }
}
exports.MfaDuo = MfaDuo;
/** @internal */
MfaDuo.__pulumiType = 'vault:index/mfaDuo:MfaDuo';
//# sourceMappingURL=mfaDuo.js.map