UNPKG

@pulumi/vault

Version:

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

134 lines 6.04 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.AuthBackendRole = void 0; const pulumi = require("@pulumi/pulumi"); const utilities = require("../utilities"); /** * Provides a resource to create a role in an [GCP auth backend within Vault](https://www.vaultproject.io/docs/auth/gcp.html). * * ## Example Usage * * ```typescript * import * as pulumi from "@pulumi/pulumi"; * import * as vault from "@pulumi/vault"; * * const gcp = new vault.AuthBackend("gcp", { * path: "gcp", * type: "gcp", * }); * const test = new vault.gcp.AuthBackendRole("test", { * backend: gcp.path, * role: "test", * type: "iam", * boundServiceAccounts: ["test"], * boundProjects: ["test"], * tokenTtl: 300, * tokenMaxTtl: 600, * tokenPolicies: [ * "policy_a", * "policy_b", * ], * addGroupAliases: true, * }); * ``` * * ## Import * * GCP authentication roles can be imported using the `path`, e.g. * * ```sh * $ pulumi import vault:gcp/authBackendRole:AuthBackendRole my_role auth/gcp/role/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["addGroupAliases"] = state?.addGroupAliases; resourceInputs["allowGceInference"] = state?.allowGceInference; resourceInputs["backend"] = state?.backend; resourceInputs["boundInstanceGroups"] = state?.boundInstanceGroups; resourceInputs["boundLabels"] = state?.boundLabels; resourceInputs["boundProjects"] = state?.boundProjects; resourceInputs["boundRegions"] = state?.boundRegions; resourceInputs["boundServiceAccounts"] = state?.boundServiceAccounts; resourceInputs["boundZones"] = state?.boundZones; resourceInputs["maxJwtExp"] = state?.maxJwtExp; resourceInputs["namespace"] = state?.namespace; resourceInputs["role"] = state?.role; 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; resourceInputs["type"] = state?.type; } else { const args = argsOrState; if (args?.role === undefined && !opts.urn) { throw new Error("Missing required property 'role'"); } if (args?.type === undefined && !opts.urn) { throw new Error("Missing required property 'type'"); } resourceInputs["addGroupAliases"] = args?.addGroupAliases; resourceInputs["allowGceInference"] = args?.allowGceInference; resourceInputs["backend"] = args?.backend; resourceInputs["boundInstanceGroups"] = args?.boundInstanceGroups; resourceInputs["boundLabels"] = args?.boundLabels; resourceInputs["boundProjects"] = args?.boundProjects; resourceInputs["boundRegions"] = args?.boundRegions; resourceInputs["boundServiceAccounts"] = args?.boundServiceAccounts; resourceInputs["boundZones"] = args?.boundZones; resourceInputs["maxJwtExp"] = args?.maxJwtExp; resourceInputs["namespace"] = args?.namespace; resourceInputs["role"] = args?.role; 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; resourceInputs["type"] = args?.type; } opts = pulumi.mergeOptions(utilities.resourceOptsDefaults(), opts); super(AuthBackendRole.__pulumiType, name, resourceInputs, opts); } } exports.AuthBackendRole = AuthBackendRole; /** @internal */ AuthBackendRole.__pulumiType = 'vault:gcp/authBackendRole:AuthBackendRole'; //# sourceMappingURL=authBackendRole.js.map