@pulumi/vault
Version:
A Pulumi package for creating and managing HashiCorp Vault cloud resources.
113 lines • 4.12 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.EntityPolicies = void 0;
const pulumi = require("@pulumi/pulumi");
const utilities = require("../utilities");
/**
* Manages policies for an Identity Entity for Vault. The [Identity secrets engine](https://www.vaultproject.io/docs/secrets/identity/index.html) is the identity management solution for Vault.
*
* ## Example Usage
*
* ### Exclusive Policies
*
* ```typescript
* import * as pulumi from "@pulumi/pulumi";
* import * as vault from "@pulumi/vault";
*
* const entity = new vault.identity.Entity("entity", {
* name: "entity",
* externalPolicies: true,
* });
* const policies = new vault.identity.EntityPolicies("policies", {
* policies: [
* "default",
* "test",
* ],
* exclusive: true,
* entityId: entity.id,
* });
* ```
*
* ### Non-exclusive Policies
*
* ```typescript
* import * as pulumi from "@pulumi/pulumi";
* import * as vault from "@pulumi/vault";
*
* const entity = new vault.identity.Entity("entity", {
* name: "entity",
* externalPolicies: true,
* });
* const _default = new vault.identity.EntityPolicies("default", {
* policies: [
* "default",
* "test",
* ],
* exclusive: false,
* entityId: entity.id,
* });
* const others = new vault.identity.EntityPolicies("others", {
* policies: ["others"],
* exclusive: false,
* entityId: entity.id,
* });
* ```
*/
class EntityPolicies extends pulumi.CustomResource {
/**
* Get an existing EntityPolicies 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 EntityPolicies(name, state, { ...opts, id: id });
}
/**
* Returns true if the given object is an instance of EntityPolicies. 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'] === EntityPolicies.__pulumiType;
}
constructor(name, argsOrState, opts) {
let resourceInputs = {};
opts = opts || {};
if (opts.id) {
const state = argsOrState;
resourceInputs["entityId"] = state?.entityId;
resourceInputs["entityName"] = state?.entityName;
resourceInputs["exclusive"] = state?.exclusive;
resourceInputs["namespace"] = state?.namespace;
resourceInputs["policies"] = state?.policies;
}
else {
const args = argsOrState;
if (args?.entityId === undefined && !opts.urn) {
throw new Error("Missing required property 'entityId'");
}
if (args?.policies === undefined && !opts.urn) {
throw new Error("Missing required property 'policies'");
}
resourceInputs["entityId"] = args?.entityId;
resourceInputs["exclusive"] = args?.exclusive;
resourceInputs["namespace"] = args?.namespace;
resourceInputs["policies"] = args?.policies;
resourceInputs["entityName"] = undefined /*out*/;
}
opts = pulumi.mergeOptions(utilities.resourceOptsDefaults(), opts);
super(EntityPolicies.__pulumiType, name, resourceInputs, opts);
}
}
exports.EntityPolicies = EntityPolicies;
/** @internal */
EntityPolicies.__pulumiType = 'vault:identity/entityPolicies:EntityPolicies';
//# sourceMappingURL=entityPolicies.js.map