UNPKG

@pulumi/gcp

Version:

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

144 lines 6.24 kB
"use strict"; // *** WARNING: this file was generated by the Pulumi Terraform Bridge (tfgen) Tool. *** // *** Do not edit by hand unless you're certain you know what you are doing! *** Object.defineProperty(exports, "__esModule", { value: true }); exports.WorkforcePool = void 0; const pulumi = require("@pulumi/pulumi"); const utilities = 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}} * ``` * * ```sh * $ 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, Object.assign(Object.assign({}, opts), { id: id })); } /** * 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 ? state.accessRestrictions : undefined; resourceInputs["description"] = state ? state.description : undefined; resourceInputs["disabled"] = state ? state.disabled : undefined; resourceInputs["displayName"] = state ? state.displayName : undefined; resourceInputs["location"] = state ? state.location : undefined; resourceInputs["name"] = state ? state.name : undefined; resourceInputs["parent"] = state ? state.parent : undefined; resourceInputs["sessionDuration"] = state ? state.sessionDuration : undefined; resourceInputs["state"] = state ? state.state : undefined; resourceInputs["workforcePoolId"] = state ? state.workforcePoolId : undefined; } else { const args = argsOrState; if ((!args || args.location === undefined) && !opts.urn) { throw new Error("Missing required property 'location'"); } if ((!args || args.parent === undefined) && !opts.urn) { throw new Error("Missing required property 'parent'"); } if ((!args || args.workforcePoolId === undefined) && !opts.urn) { throw new Error("Missing required property 'workforcePoolId'"); } resourceInputs["accessRestrictions"] = args ? args.accessRestrictions : undefined; resourceInputs["description"] = args ? args.description : undefined; resourceInputs["disabled"] = args ? args.disabled : undefined; resourceInputs["displayName"] = args ? args.displayName : undefined; resourceInputs["location"] = args ? args.location : undefined; resourceInputs["parent"] = args ? args.parent : undefined; resourceInputs["sessionDuration"] = args ? args.sessionDuration : undefined; resourceInputs["workforcePoolId"] = args ? args.workforcePoolId : undefined; resourceInputs["name"] = undefined /*out*/; resourceInputs["state"] = undefined /*out*/; } opts = pulumi.mergeOptions(utilities.resourceOptsDefaults(), opts); super(WorkforcePool.__pulumiType, name, resourceInputs, opts); } } exports.WorkforcePool = WorkforcePool; /** @internal */ WorkforcePool.__pulumiType = 'gcp:iam/workforcePool:WorkforcePool'; //# sourceMappingURL=workforcePool.js.map