@pulumi/vault
Version:
A Pulumi package for creating and managing HashiCorp Vault cloud resources.
105 lines • 4.72 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.GroupAlias = void 0;
const pulumi = require("@pulumi/pulumi");
const utilities = require("../utilities");
/**
* Creates an Identity Group Alias for Vault. The [Identity secrets engine](https://www.vaultproject.io/docs/secrets/identity/index.html) is the identity management solution for Vault.
*
* Group aliases allows entity membership in external groups to be managed semi-automatically. External group serves as a mapping to a group that is outside of the identity store. External groups can have one (and only one) alias. This alias should map to a notion of group that is outside of the identity store. For example, groups in LDAP, and teams in GitHub. A username in LDAP, belonging to a group in LDAP, can get its entity ID added as a member of a group in Vault automatically during logins and token renewals. This works only if the group in Vault is an external group and has an alias that maps to the group in LDAP. If the user is removed from the group in LDAP, that change gets reflected in Vault only upon the subsequent login or renewal operation.
*
* ## Example Usage
*
* ```typescript
* import * as pulumi from "@pulumi/pulumi";
* import * as vault from "@pulumi/vault";
*
* const group = new vault.identity.Group("group", {
* name: "test",
* type: "external",
* policies: ["test"],
* });
* const github = new vault.AuthBackend("github", {
* type: "github",
* path: "github",
* });
* const group_alias = new vault.identity.GroupAlias("group-alias", {
* name: "Github_Team_Slug",
* mountAccessor: github.accessor,
* canonicalId: group.id,
* });
* ```
*
* ## Import
*
* The group alias can be imported with the group alias `id`, for example:
*
* ```sh
* $ pulumi import vault:identity/groupAlias:GroupAlias group-alias id
* ```
*
* Group aliases can also be imported using the UUID of the alias record, e.g.
*
* ```sh
* $ pulumi import vault:identity/groupAlias:GroupAlias alias_name 63104e20-88e4-11eb-8d04-cf7ac9d60157
* ```
*/
class GroupAlias extends pulumi.CustomResource {
/**
* Get an existing GroupAlias 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 GroupAlias(name, state, { ...opts, id: id });
}
/**
* Returns true if the given object is an instance of GroupAlias. 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'] === GroupAlias.__pulumiType;
}
constructor(name, argsOrState, opts) {
let resourceInputs = {};
opts = opts || {};
if (opts.id) {
const state = argsOrState;
resourceInputs["canonicalId"] = state?.canonicalId;
resourceInputs["mountAccessor"] = state?.mountAccessor;
resourceInputs["name"] = state?.name;
resourceInputs["namespace"] = state?.namespace;
}
else {
const args = argsOrState;
if (args?.canonicalId === undefined && !opts.urn) {
throw new Error("Missing required property 'canonicalId'");
}
if (args?.mountAccessor === undefined && !opts.urn) {
throw new Error("Missing required property 'mountAccessor'");
}
if (args?.name === undefined && !opts.urn) {
throw new Error("Missing required property 'name'");
}
resourceInputs["canonicalId"] = args?.canonicalId;
resourceInputs["mountAccessor"] = args?.mountAccessor;
resourceInputs["name"] = args?.name;
resourceInputs["namespace"] = args?.namespace;
}
opts = pulumi.mergeOptions(utilities.resourceOptsDefaults(), opts);
super(GroupAlias.__pulumiType, name, resourceInputs, opts);
}
}
exports.GroupAlias = GroupAlias;
/** @internal */
GroupAlias.__pulumiType = 'vault:identity/groupAlias:GroupAlias';
//# sourceMappingURL=groupAlias.js.map