@pulumi/vault
Version:
A Pulumi package for creating and managing HashiCorp Vault cloud resources.
103 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.SecretLibrary = 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 config = new vault.ad.SecretBackend("config", {
* backend: "ad",
* binddn: "CN=Administrator,CN=Users,DC=corp,DC=example,DC=net",
* bindpass: "SuperSecretPassw0rd",
* url: "ldaps://ad",
* insecureTls: true,
* userdn: "CN=Users,DC=corp,DC=example,DC=net",
* });
* const qa = new vault.ad.SecretLibrary("qa", {
* backend: config.backend,
* name: "qa",
* serviceAccountNames: [
* "Bob",
* "Mary",
* ],
* ttl: 60,
* disableCheckInEnforcement: true,
* maxTtl: 120,
* });
* ```
*
* ## Import
*
* AD secret backend libraries can be imported using the `path`, e.g.
*
* ```sh
* $ pulumi import vault:ad/secretLibrary:SecretLibrary role ad/library/bob
* ```
*/
class SecretLibrary extends pulumi.CustomResource {
/**
* Get an existing SecretLibrary 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 SecretLibrary(name, state, { ...opts, id: id });
}
/**
* Returns true if the given object is an instance of SecretLibrary. 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'] === SecretLibrary.__pulumiType;
}
constructor(name, argsOrState, opts) {
let resourceInputs = {};
opts = opts || {};
if (opts.id) {
const state = argsOrState;
resourceInputs["backend"] = state?.backend;
resourceInputs["disableCheckInEnforcement"] = state?.disableCheckInEnforcement;
resourceInputs["maxTtl"] = state?.maxTtl;
resourceInputs["name"] = state?.name;
resourceInputs["namespace"] = state?.namespace;
resourceInputs["serviceAccountNames"] = state?.serviceAccountNames;
resourceInputs["ttl"] = state?.ttl;
}
else {
const args = argsOrState;
if (args?.backend === undefined && !opts.urn) {
throw new Error("Missing required property 'backend'");
}
if (args?.serviceAccountNames === undefined && !opts.urn) {
throw new Error("Missing required property 'serviceAccountNames'");
}
resourceInputs["backend"] = args?.backend;
resourceInputs["disableCheckInEnforcement"] = args?.disableCheckInEnforcement;
resourceInputs["maxTtl"] = args?.maxTtl;
resourceInputs["name"] = args?.name;
resourceInputs["namespace"] = args?.namespace;
resourceInputs["serviceAccountNames"] = args?.serviceAccountNames;
resourceInputs["ttl"] = args?.ttl;
}
opts = pulumi.mergeOptions(utilities.resourceOptsDefaults(), opts);
super(SecretLibrary.__pulumiType, name, resourceInputs, opts);
}
}
exports.SecretLibrary = SecretLibrary;
/** @internal */
SecretLibrary.__pulumiType = 'vault:ad/secretLibrary:SecretLibrary';
//# sourceMappingURL=secretLibrary.js.map