UNPKG

@pulumi/vault

Version:

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

151 lines 5.57 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.Group = void 0; const pulumi = require("@pulumi/pulumi"); const utilities = require("../utilities"); /** * Creates an Identity Group for Vault. The [Identity secrets engine](https://www.vaultproject.io/docs/secrets/identity/index.html) is the identity management solution for Vault. * * A group can contain multiple entities as its members. A group can also have subgroups. Policies set on the group is granted to all members of the group. During request time, when the token's entity ID is being evaluated for the policies that it has access to; along with the policies on the entity itself, policies that are inherited due to group memberships are also granted. * * ## Example Usage * * ### Internal Group * * ```typescript * import * as pulumi from "@pulumi/pulumi"; * import * as vault from "@pulumi/vault"; * * const internal = new vault.identity.Group("internal", { * name: "internal", * type: "internal", * policies: [ * "dev", * "test", * ], * metadata: { * version: "2", * }, * }); * ``` * * ### External Group * * ```typescript * import * as pulumi from "@pulumi/pulumi"; * import * as vault from "@pulumi/vault"; * * const group = new vault.identity.Group("group", { * name: "external", * type: "external", * policies: ["test"], * metadata: { * version: "1", * }, * }); * ``` * * ## Caveats * * It's important to note that Vault identity groups names are *case-insensitive*. For example the following resources would be equivalent. * Applying this configuration would result in the provider failing to create one of the identity groups, since the resources share the same `name`. * * This sort of pattern should be avoided: * ```typescript * import * as pulumi from "@pulumi/pulumi"; * import * as vault from "@pulumi/vault"; * * const internal = new vault.identity.Group("internal", { * name: "internal", * type: "internal", * policies: [ * "dev", * "test", * ], * metadata: { * version: "2", * }, * }); * const internalGroup = new vault.identity.Group("Internal", { * name: "Internal", * type: "internal", * policies: [ * "dev", * "test", * ], * metadata: { * version: "2", * }, * }); * ``` * * ## Import * * Identity group can be imported using the `id`, e.g. * * ```sh * $ pulumi import vault:identity/group:Group test 'fcbf1efb-2b69-4209-bed8-811e3475dad3' * ``` */ class Group extends pulumi.CustomResource { /** * Get an existing Group 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 Group(name, state, { ...opts, id: id }); } /** * Returns true if the given object is an instance of Group. 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'] === Group.__pulumiType; } constructor(name, argsOrState, opts) { let resourceInputs = {}; opts = opts || {}; if (opts.id) { const state = argsOrState; resourceInputs["externalMemberEntityIds"] = state?.externalMemberEntityIds; resourceInputs["externalMemberGroupIds"] = state?.externalMemberGroupIds; resourceInputs["externalPolicies"] = state?.externalPolicies; resourceInputs["memberEntityIds"] = state?.memberEntityIds; resourceInputs["memberGroupIds"] = state?.memberGroupIds; resourceInputs["metadata"] = state?.metadata; resourceInputs["name"] = state?.name; resourceInputs["namespace"] = state?.namespace; resourceInputs["policies"] = state?.policies; resourceInputs["type"] = state?.type; } else { const args = argsOrState; resourceInputs["externalMemberEntityIds"] = args?.externalMemberEntityIds; resourceInputs["externalMemberGroupIds"] = args?.externalMemberGroupIds; resourceInputs["externalPolicies"] = args?.externalPolicies; resourceInputs["memberEntityIds"] = args?.memberEntityIds; resourceInputs["memberGroupIds"] = args?.memberGroupIds; resourceInputs["metadata"] = args?.metadata; resourceInputs["name"] = args?.name; resourceInputs["namespace"] = args?.namespace; resourceInputs["policies"] = args?.policies; resourceInputs["type"] = args?.type; } opts = pulumi.mergeOptions(utilities.resourceOptsDefaults(), opts); super(Group.__pulumiType, name, resourceInputs, opts); } } exports.Group = Group; /** @internal */ Group.__pulumiType = 'vault:identity/group:Group'; //# sourceMappingURL=group.js.map