@pulumi/vault
Version:
A Pulumi package for creating and managing HashiCorp Vault cloud resources.
101 lines • 3.97 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.SecretRole = 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 role = new vault.ad.SecretRole("role", {
* backend: config.backend,
* role: "bob",
* serviceAccountName: "Bob",
* ttl: 60,
* });
* ```
*
* ## Import
*
* AD secret backend roles can be imported using the `path`, e.g.
*
* ```sh
* $ pulumi import vault:ad/secretRole:SecretRole role ad/roles/bob
* ```
*/
class SecretRole extends pulumi.CustomResource {
/**
* Get an existing SecretRole 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 SecretRole(name, state, { ...opts, id: id });
}
/**
* Returns true if the given object is an instance of SecretRole. 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'] === SecretRole.__pulumiType;
}
constructor(name, argsOrState, opts) {
let resourceInputs = {};
opts = opts || {};
if (opts.id) {
const state = argsOrState;
resourceInputs["backend"] = state?.backend;
resourceInputs["lastVaultRotation"] = state?.lastVaultRotation;
resourceInputs["namespace"] = state?.namespace;
resourceInputs["passwordLastSet"] = state?.passwordLastSet;
resourceInputs["role"] = state?.role;
resourceInputs["serviceAccountName"] = state?.serviceAccountName;
resourceInputs["ttl"] = state?.ttl;
}
else {
const args = argsOrState;
if (args?.backend === undefined && !opts.urn) {
throw new Error("Missing required property 'backend'");
}
if (args?.role === undefined && !opts.urn) {
throw new Error("Missing required property 'role'");
}
if (args?.serviceAccountName === undefined && !opts.urn) {
throw new Error("Missing required property 'serviceAccountName'");
}
resourceInputs["backend"] = args?.backend;
resourceInputs["namespace"] = args?.namespace;
resourceInputs["role"] = args?.role;
resourceInputs["serviceAccountName"] = args?.serviceAccountName;
resourceInputs["ttl"] = args?.ttl;
resourceInputs["lastVaultRotation"] = undefined /*out*/;
resourceInputs["passwordLastSet"] = undefined /*out*/;
}
opts = pulumi.mergeOptions(utilities.resourceOptsDefaults(), opts);
super(SecretRole.__pulumiType, name, resourceInputs, opts);
}
}
exports.SecretRole = SecretRole;
/** @internal */
SecretRole.__pulumiType = 'vault:ad/secretRole:SecretRole';
//# sourceMappingURL=secretRole.js.map