@pulumi/vault
Version:
A Pulumi package for creating and managing HashiCorp Vault cloud resources.
105 lines • 3.99 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.SecretBackendV2 = void 0;
const pulumi = require("@pulumi/pulumi");
const utilities = require("../utilities");
/**
* Configures KV-V2 backend level settings that are applied to
* every key in the key-value store.
*
* For more information on Vault's KV-V2 secret backend
* [see here](https://www.vaultproject.io/docs/secrets/kv/kv-v2).
*
* ## Example Usage
*
* ```typescript
* import * as pulumi from "@pulumi/pulumi";
* import * as vault from "@pulumi/vault";
*
* const kvv2 = new vault.Mount("kvv2", {
* path: "kvv2",
* type: "kv",
* options: {
* version: "2",
* },
* description: "KV Version 2 secret engine mount",
* });
* const example = new vault.kv.SecretBackendV2("example", {
* mount: kvv2.path,
* maxVersions: 5,
* deleteVersionAfter: 12600,
* casRequired: true,
* });
* ```
*
* ## Required Vault Capabilities
*
* Use of this resource requires the `create` or `update` capability
* (depending on whether the resource already exists) on the given path,
* the `delete` capability if the resource is removed from configuration,
* and the `read` capability for drift detection (by default).
*
* ## Import
*
* The KV-V2 secret backend can be imported using its unique ID,
* the `${mount}/config`, e.g.
*
* ```sh
* $ pulumi import vault:kv/secretBackendV2:SecretBackendV2 example kvv2/config
* ```
*/
class SecretBackendV2 extends pulumi.CustomResource {
/**
* Get an existing SecretBackendV2 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 SecretBackendV2(name, state, { ...opts, id: id });
}
/**
* Returns true if the given object is an instance of SecretBackendV2. 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'] === SecretBackendV2.__pulumiType;
}
constructor(name, argsOrState, opts) {
let resourceInputs = {};
opts = opts || {};
if (opts.id) {
const state = argsOrState;
resourceInputs["casRequired"] = state?.casRequired;
resourceInputs["deleteVersionAfter"] = state?.deleteVersionAfter;
resourceInputs["maxVersions"] = state?.maxVersions;
resourceInputs["mount"] = state?.mount;
resourceInputs["namespace"] = state?.namespace;
}
else {
const args = argsOrState;
if (args?.mount === undefined && !opts.urn) {
throw new Error("Missing required property 'mount'");
}
resourceInputs["casRequired"] = args?.casRequired;
resourceInputs["deleteVersionAfter"] = args?.deleteVersionAfter;
resourceInputs["maxVersions"] = args?.maxVersions;
resourceInputs["mount"] = args?.mount;
resourceInputs["namespace"] = args?.namespace;
}
opts = pulumi.mergeOptions(utilities.resourceOptsDefaults(), opts);
super(SecretBackendV2.__pulumiType, name, resourceInputs, opts);
}
}
exports.SecretBackendV2 = SecretBackendV2;
/** @internal */
SecretBackendV2.__pulumiType = 'vault:kv/secretBackendV2:SecretBackendV2';
//# sourceMappingURL=secretBackendV2.js.map