UNPKG

@pulumi/vault

Version:

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

103 lines 4.33 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.SecretBackendStaticRole = 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.ldap.SecretBackend("config", { * path: "my-custom-ldap", * binddn: "CN=Administrator,CN=Users,DC=corp,DC=example,DC=net", * bindpass: "SuperSecretPassw0rd", * url: "ldaps://localhost", * insecureTls: true, * userdn: "CN=Users,DC=corp,DC=example,DC=net", * }); * const role = new vault.ldap.SecretBackendStaticRole("role", { * mount: config.path, * username: "alice", * dn: "cn=alice,ou=Users,DC=corp,DC=example,DC=net", * roleName: "alice", * rotationPeriod: 60, * }); * ``` * * ## Import * * LDAP secret backend static role can be imported using the full path to the role * of the form: `<mount_path>/static-role/<role_name>` e.g. * * ```sh * $ pulumi import vault:ldap/secretBackendStaticRole:SecretBackendStaticRole role ldap/static-role/example-role * ``` */ class SecretBackendStaticRole extends pulumi.CustomResource { /** * Get an existing SecretBackendStaticRole 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 SecretBackendStaticRole(name, state, { ...opts, id: id }); } /** * Returns true if the given object is an instance of SecretBackendStaticRole. 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'] === SecretBackendStaticRole.__pulumiType; } constructor(name, argsOrState, opts) { let resourceInputs = {}; opts = opts || {}; if (opts.id) { const state = argsOrState; resourceInputs["dn"] = state?.dn; resourceInputs["mount"] = state?.mount; resourceInputs["namespace"] = state?.namespace; resourceInputs["roleName"] = state?.roleName; resourceInputs["rotationPeriod"] = state?.rotationPeriod; resourceInputs["skipImportRotation"] = state?.skipImportRotation; resourceInputs["username"] = state?.username; } else { const args = argsOrState; if (args?.roleName === undefined && !opts.urn) { throw new Error("Missing required property 'roleName'"); } if (args?.rotationPeriod === undefined && !opts.urn) { throw new Error("Missing required property 'rotationPeriod'"); } if (args?.username === undefined && !opts.urn) { throw new Error("Missing required property 'username'"); } resourceInputs["dn"] = args?.dn; resourceInputs["mount"] = args?.mount; resourceInputs["namespace"] = args?.namespace; resourceInputs["roleName"] = args?.roleName; resourceInputs["rotationPeriod"] = args?.rotationPeriod; resourceInputs["skipImportRotation"] = args?.skipImportRotation; resourceInputs["username"] = args?.username; } opts = pulumi.mergeOptions(utilities.resourceOptsDefaults(), opts); super(SecretBackendStaticRole.__pulumiType, name, resourceInputs, opts); } } exports.SecretBackendStaticRole = SecretBackendStaticRole; /** @internal */ SecretBackendStaticRole.__pulumiType = 'vault:ldap/secretBackendStaticRole:SecretBackendStaticRole'; //# sourceMappingURL=secretBackendStaticRole.js.map