@pulumi/vault
Version:
A Pulumi package for creating and managing HashiCorp Vault cloud resources.
123 lines • 5.65 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.AuthBackendRole = void 0;
const pulumi = require("@pulumi/pulumi");
const utilities = require("../utilities");
/**
* Manages Token auth backend role in a Vault server. See the [Vault
* documentation](https://www.vaultproject.io/docs/auth/token.html) for more
* information.
*
* ## Example Usage
*
* ```typescript
* import * as pulumi from "@pulumi/pulumi";
* import * as vault from "@pulumi/vault";
*
* const example = new vault.tokenauth.AuthBackendRole("example", {
* roleName: "my-role",
* allowedPolicies: [
* "dev",
* "test",
* ],
* disallowedPolicies: ["default"],
* allowedEntityAliases: ["test_entity"],
* orphan: true,
* tokenPeriod: 86400,
* renewable: true,
* tokenExplicitMaxTtl: 115200,
* pathSuffix: "path-suffix",
* });
* ```
*
* ## Import
*
* Token auth backend roles can be imported with `auth/token/roles/` followed by the `role_name`, e.g.
*
* ```sh
* $ pulumi import vault:tokenauth/authBackendRole:AuthBackendRole example auth/token/roles/my-role
* ```
*/
class AuthBackendRole extends pulumi.CustomResource {
/**
* Get an existing AuthBackendRole 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 AuthBackendRole(name, state, { ...opts, id: id });
}
/**
* Returns true if the given object is an instance of AuthBackendRole. 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'] === AuthBackendRole.__pulumiType;
}
constructor(name, argsOrState, opts) {
let resourceInputs = {};
opts = opts || {};
if (opts.id) {
const state = argsOrState;
resourceInputs["allowedEntityAliases"] = state?.allowedEntityAliases;
resourceInputs["allowedPolicies"] = state?.allowedPolicies;
resourceInputs["allowedPoliciesGlobs"] = state?.allowedPoliciesGlobs;
resourceInputs["disallowedPolicies"] = state?.disallowedPolicies;
resourceInputs["disallowedPoliciesGlobs"] = state?.disallowedPoliciesGlobs;
resourceInputs["namespace"] = state?.namespace;
resourceInputs["orphan"] = state?.orphan;
resourceInputs["pathSuffix"] = state?.pathSuffix;
resourceInputs["renewable"] = state?.renewable;
resourceInputs["roleName"] = state?.roleName;
resourceInputs["tokenBoundCidrs"] = state?.tokenBoundCidrs;
resourceInputs["tokenExplicitMaxTtl"] = state?.tokenExplicitMaxTtl;
resourceInputs["tokenMaxTtl"] = state?.tokenMaxTtl;
resourceInputs["tokenNoDefaultPolicy"] = state?.tokenNoDefaultPolicy;
resourceInputs["tokenNumUses"] = state?.tokenNumUses;
resourceInputs["tokenPeriod"] = state?.tokenPeriod;
resourceInputs["tokenPolicies"] = state?.tokenPolicies;
resourceInputs["tokenTtl"] = state?.tokenTtl;
resourceInputs["tokenType"] = state?.tokenType;
}
else {
const args = argsOrState;
if (args?.roleName === undefined && !opts.urn) {
throw new Error("Missing required property 'roleName'");
}
resourceInputs["allowedEntityAliases"] = args?.allowedEntityAliases;
resourceInputs["allowedPolicies"] = args?.allowedPolicies;
resourceInputs["allowedPoliciesGlobs"] = args?.allowedPoliciesGlobs;
resourceInputs["disallowedPolicies"] = args?.disallowedPolicies;
resourceInputs["disallowedPoliciesGlobs"] = args?.disallowedPoliciesGlobs;
resourceInputs["namespace"] = args?.namespace;
resourceInputs["orphan"] = args?.orphan;
resourceInputs["pathSuffix"] = args?.pathSuffix;
resourceInputs["renewable"] = args?.renewable;
resourceInputs["roleName"] = args?.roleName;
resourceInputs["tokenBoundCidrs"] = args?.tokenBoundCidrs;
resourceInputs["tokenExplicitMaxTtl"] = args?.tokenExplicitMaxTtl;
resourceInputs["tokenMaxTtl"] = args?.tokenMaxTtl;
resourceInputs["tokenNoDefaultPolicy"] = args?.tokenNoDefaultPolicy;
resourceInputs["tokenNumUses"] = args?.tokenNumUses;
resourceInputs["tokenPeriod"] = args?.tokenPeriod;
resourceInputs["tokenPolicies"] = args?.tokenPolicies;
resourceInputs["tokenTtl"] = args?.tokenTtl;
resourceInputs["tokenType"] = args?.tokenType;
}
opts = pulumi.mergeOptions(utilities.resourceOptsDefaults(), opts);
super(AuthBackendRole.__pulumiType, name, resourceInputs, opts);
}
}
exports.AuthBackendRole = AuthBackendRole;
/** @internal */
AuthBackendRole.__pulumiType = 'vault:tokenauth/authBackendRole:AuthBackendRole';
//# sourceMappingURL=authBackendRole.js.map