UNPKG

@pulumi/gcp

Version:

A Pulumi package for creating and managing Google Cloud Platform resources.

165 lines 7 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! *** var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) { if (k2 === undefined) k2 = k; var desc = Object.getOwnPropertyDescriptor(m, k); if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) { desc = { enumerable: true, get: function() { return m[k]; } }; } Object.defineProperty(o, k2, desc); }) : (function(o, m, k, k2) { if (k2 === undefined) k2 = k; o[k2] = m[k]; })); var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) { Object.defineProperty(o, "default", { enumerable: true, value: v }); }) : function(o, v) { o["default"] = v; }); var __importStar = (this && this.__importStar) || function (mod) { if (mod && mod.__esModule) return mod; var result = {}; if (mod != null) for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k); __setModuleDefault(result, mod); return result; }; Object.defineProperty(exports, "__esModule", { value: true }); exports.WorkforcePool = void 0; const pulumi = __importStar(require("@pulumi/pulumi")); const utilities = __importStar(require("../utilities")); /** * Represents a collection of external workforces. Provides namespaces for * federated users that can be referenced in IAM policies. * * To get more information about WorkforcePool, see: * * * [API documentation](https://cloud.google.com/iam/docs/reference/rest/v1/locations.workforcePools) * * How-to Guides * * [Manage pools](https://cloud.google.com/iam/docs/manage-workforce-identity-pools-providers#manage_pools) * * > **Note:** Ask your Google Cloud account team to request access to workforce identity federation for * your billing/quota project. The account team notifies you when the project is granted access. * * ## Example Usage * * ### Iam Workforce Pool Basic * * ```typescript * import * as pulumi from "@pulumi/pulumi"; * import * as gcp from "@pulumi/gcp"; * * const example = new gcp.iam.WorkforcePool("example", { * workforcePoolId: "example-pool", * parent: "organizations/123456789", * location: "global", * }); * ``` * ### Iam Workforce Pool Full * * ```typescript * import * as pulumi from "@pulumi/pulumi"; * import * as gcp from "@pulumi/gcp"; * * const example = new gcp.iam.WorkforcePool("example", { * workforcePoolId: "example-pool", * parent: "organizations/123456789", * location: "global", * displayName: "Display name", * description: "A sample workforce pool.", * disabled: false, * sessionDuration: "7200s", * accessRestrictions: { * allowedServices: [{ * domain: "backstory.chronicle.security", * }], * disableProgrammaticSignin: false, * }, * }); * ``` * * ## Import * * WorkforcePool can be imported using any of these accepted formats: * * * `locations/{{location}}/workforcePools/{{workforce_pool_id}}` * * `{{location}}/{{workforce_pool_id}}` * * When using the `pulumi import` command, WorkforcePool can be imported using one of the formats above. For example: * * ```sh * $ pulumi import gcp:iam/workforcePool:WorkforcePool default locations/{{location}}/workforcePools/{{workforce_pool_id}} * $ pulumi import gcp:iam/workforcePool:WorkforcePool default {{location}}/{{workforce_pool_id}} * ``` */ class WorkforcePool extends pulumi.CustomResource { /** * Get an existing WorkforcePool 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 WorkforcePool(name, state, { ...opts, id: id }); } /** @internal */ static __pulumiType = 'gcp:iam/workforcePool:WorkforcePool'; /** * Returns true if the given object is an instance of WorkforcePool. 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'] === WorkforcePool.__pulumiType; } constructor(name, argsOrState, opts) { let resourceInputs = {}; opts = opts || {}; if (opts.id) { const state = argsOrState; resourceInputs["accessRestrictions"] = state?.accessRestrictions; resourceInputs["deletionPolicy"] = state?.deletionPolicy; resourceInputs["description"] = state?.description; resourceInputs["disabled"] = state?.disabled; resourceInputs["displayName"] = state?.displayName; resourceInputs["location"] = state?.location; resourceInputs["name"] = state?.name; resourceInputs["parent"] = state?.parent; resourceInputs["sessionDuration"] = state?.sessionDuration; resourceInputs["state"] = state?.state; resourceInputs["workforcePoolId"] = state?.workforcePoolId; } else { const args = argsOrState; if (args?.location === undefined && !opts.urn) { throw new Error("Missing required property 'location'"); } if (args?.parent === undefined && !opts.urn) { throw new Error("Missing required property 'parent'"); } if (args?.workforcePoolId === undefined && !opts.urn) { throw new Error("Missing required property 'workforcePoolId'"); } resourceInputs["accessRestrictions"] = args?.accessRestrictions; resourceInputs["deletionPolicy"] = args?.deletionPolicy; resourceInputs["description"] = args?.description; resourceInputs["disabled"] = args?.disabled; resourceInputs["displayName"] = args?.displayName; resourceInputs["location"] = args?.location; resourceInputs["parent"] = args?.parent; resourceInputs["sessionDuration"] = args?.sessionDuration; resourceInputs["workforcePoolId"] = args?.workforcePoolId; resourceInputs["name"] = undefined /*out*/; resourceInputs["state"] = undefined /*out*/; } opts = pulumi.mergeOptions(utilities.resourceOptsDefaults(), opts); super(WorkforcePool.__pulumiType, name, resourceInputs, opts); } } exports.WorkforcePool = WorkforcePool; //# sourceMappingURL=workforcePool.js.map