WorkforcePool class

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:

> 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

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",
});
import pulumi
import pulumi_gcp as gcp

example = gcp.iam.WorkforcePool("example",
    workforce_pool_id="example-pool",
    parent="organizations/123456789",
    location="global")
using System.Collections.Generic;
using System.Linq;
using Pulumi;
using Gcp = Pulumi.Gcp;

return await Deployment.RunAsync(() =>
{
    var example = new Gcp.Iam.WorkforcePool("example", new()
    {
        WorkforcePoolId = "example-pool",
        Parent = "organizations/123456789",
        Location = "global",
    });

});
package main

import (
	"github.com/pulumi/pulumi-gcp/sdk/v9/go/gcp/iam"
	"github.com/pulumi/pulumi/sdk/v3/go/pulumi"
)

func main() {
	pulumi.Run(func(ctx *pulumi.Context) error {
		_, err := iam.NewWorkforcePool(ctx, "example", &iam.WorkforcePoolArgs{
			WorkforcePoolId: pulumi.String("example-pool"),
			Parent:          pulumi.String("organizations/123456789"),
			Location:        pulumi.String("global"),
		})
		if err != nil {
			return err
		}
		return nil
	})
}
pulumi {
  required_providers {
    gcp = {
      source = "pulumi/gcp"
    }
  }
}

resource "gcp_iam_workforcepool" "example" {
  workforce_pool_id = "example-pool"
  parent            = "organizations/123456789"
  location          = "global"
}
package generated_program;

import com.pulumi.Context;
import com.pulumi.Pulumi;
import com.pulumi.core.Output;
import com.pulumi.gcp.iam.WorkforcePool;
import com.pulumi.gcp.iam.WorkforcePoolArgs;
import java.util.ArrayList;
import java.util.Arrays;
import java.util.Map;
import java.io.File;
import java.nio.file.Files;
import java.nio.file.Paths;

public class App {
    public static void main(String[] args) {
        Pulumi.run(App::stack);
    }

    public static void stack(Context ctx) {
        var example = new WorkforcePool("example", WorkforcePoolArgs.builder()
            .workforcePoolId("example-pool")
            .parent("organizations/123456789")
            .location("global")
            .build());

    }
}
resources:
  example:
    type: gcp:iam:WorkforcePool
    properties:
      workforcePoolId: example-pool
      parent: organizations/123456789
      location: global

Iam Workforce Pool Full

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 pulumi
import pulumi_gcp as gcp

example = gcp.iam.WorkforcePool("example",
    workforce_pool_id="example-pool",
    parent="organizations/123456789",
    location="global",
    display_name="Display name",
    description="A sample workforce pool.",
    disabled=False,
    session_duration="7200s",
    access_restrictions={
        "allowed_services": [{
            "domain": "backstory.chronicle.security",
        }],
        "disable_programmatic_signin": False,
    })
using System.Collections.Generic;
using System.Linq;
using Pulumi;
using Gcp = Pulumi.Gcp;

return await Deployment.RunAsync(() =>
{
    var example = new Gcp.Iam.WorkforcePool("example", new()
    {
        WorkforcePoolId = "example-pool",
        Parent = "organizations/123456789",
        Location = "global",
        DisplayName = "Display name",
        Description = "A sample workforce pool.",
        Disabled = false,
        SessionDuration = "7200s",
        AccessRestrictions = new Gcp.Iam.Inputs.WorkforcePoolAccessRestrictionsArgs
        {
            AllowedServices = new[]
            {
                new Gcp.Iam.Inputs.WorkforcePoolAccessRestrictionsAllowedServiceArgs
                {
                    Domain = "backstory.chronicle.security",
                },
            },
            DisableProgrammaticSignin = false,
        },
    });

});
package main

import (
	"github.com/pulumi/pulumi-gcp/sdk/v9/go/gcp/iam"
	"github.com/pulumi/pulumi/sdk/v3/go/pulumi"
)

func main() {
	pulumi.Run(func(ctx *pulumi.Context) error {
		_, err := iam.NewWorkforcePool(ctx, "example", &iam.WorkforcePoolArgs{
			WorkforcePoolId: pulumi.String("example-pool"),
			Parent:          pulumi.String("organizations/123456789"),
			Location:        pulumi.String("global"),
			DisplayName:     pulumi.String("Display name"),
			Description:     pulumi.String("A sample workforce pool."),
			Disabled:        pulumi.Bool(false),
			SessionDuration: pulumi.String("7200s"),
			AccessRestrictions: &iam.WorkforcePoolAccessRestrictionsArgs{
				AllowedServices: iam.WorkforcePoolAccessRestrictionsAllowedServiceArray{
					&iam.WorkforcePoolAccessRestrictionsAllowedServiceArgs{
						Domain: pulumi.String("backstory.chronicle.security"),
					},
				},
				DisableProgrammaticSignin: pulumi.Bool(false),
			},
		})
		if err != nil {
			return err
		}
		return nil
	})
}
pulumi {
  required_providers {
    gcp = {
      source = "pulumi/gcp"
    }
  }
}

resource "gcp_iam_workforcepool" "example" {
  workforce_pool_id = "example-pool"
  parent            = "organizations/123456789"
  location          = "global"
  display_name      = "Display name"
  description       = "A sample workforce pool."
  disabled          = false
  session_duration  = "7200s"
  access_restrictions = {
    allowed_services = [{
      "domain" = "backstory.chronicle.security"
    }]
    disable_programmatic_signin = false
  }
}
package generated_program;

import com.pulumi.Context;
import com.pulumi.Pulumi;
import com.pulumi.core.Output;
import com.pulumi.gcp.iam.WorkforcePool;
import com.pulumi.gcp.iam.WorkforcePoolArgs;
import com.pulumi.gcp.iam.inputs.WorkforcePoolAccessRestrictionsArgs;
import com.pulumi.gcp.iam.inputs.WorkforcePoolAccessRestrictionsAllowedServiceArgs;
import java.util.ArrayList;
import java.util.Arrays;
import java.util.Map;
import java.io.File;
import java.nio.file.Files;
import java.nio.file.Paths;

public class App {
    public static void main(String[] args) {
        Pulumi.run(App::stack);
    }

    public static void stack(Context ctx) {
        var example = new WorkforcePool("example", WorkforcePoolArgs.builder()
            .workforcePoolId("example-pool")
            .parent("organizations/123456789")
            .location("global")
            .displayName("Display name")
            .description("A sample workforce pool.")
            .disabled(false)
            .sessionDuration("7200s")
            .accessRestrictions(WorkforcePoolAccessRestrictionsArgs.builder()
                .allowedServices(WorkforcePoolAccessRestrictionsAllowedServiceArgs.builder()
                    .domain("backstory.chronicle.security")
                    .build())
                .disableProgrammaticSignin(false)
                .build())
            .build());

    }
}
resources:
  example:
    type: gcp:iam:WorkforcePool
    properties:
      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:

$ pulumi import gcp:iam/workforcePool:WorkforcePool default locations/{{location}}/workforcePools/{{workforce_pool_id}}
$ pulumi import gcp:iam/workforcePool:WorkforcePool default {{location}}/{{workforce_pool_id}}

Constructors

WorkforcePool(String name, {WorkforcePoolArgs? args, CustomResourceOptions? options})
Creates a new WorkforcePool. name The Pulumi resource name. args Arguments used to configure this WorkforcePool. The set of arguments for WorkforcePool. options Resource options controlling this resource's behavior.
WorkforcePool.reference(String urn)
Creates a typed reference to an existing WorkforcePool resource.

Properties

accessRestrictions ↔ Output<WorkforcePoolAccessRestrictions?>
Configure access restrictions on the workforce pool users. This is an optional field. If specified web sign-in can be restricted to given set of services or programmatic sign-in can be disabled for pool users. Structure is documented below.
latefinal
childResources → Set<Resource>
finalinherited
completionSources ↔ Map<String, IOutputCompletionSource>
latefinalinherited
deletionPolicy ↔ Output<String>
Whether Terraform will be prevented from destroying the resource. Defaults to DELETE. When a 'terraform destroy' or 'pulumi up' would delete the resource, the command will fail if this field is set to "PREVENT" in Terraform state. When set to "ABANDON", the command will remove the resource from Terraform management without updating or deleting the resource in the API. When set to "DELETE", deleting the resource is allowed.
latefinal
description ↔ Output<String?>
A user-specified description of the pool. Cannot exceed 256 characters.
latefinal
disabled ↔ Output<bool?>
Whether the pool is disabled. You cannot use a disabled pool to exchange tokens, or use existing tokens to access resources. If the pool is re-enabled, existing tokens grant access again.
latefinal
displayName ↔ Output<String?>
A user-specified display name of the pool in Google Cloud Console. Cannot exceed 32 characters.
latefinal
hashCode → int
The hash code for this object.
no setterinherited
id ↔ Output<String>
getter/setter pairinherited
isCustom → bool
Returns whether this resource is provider-managed.
no setterinherited
isProtected → bool
Returns whether this resource is protected from deletion.
no setterinherited
isRemote → bool
Whether this resource is registered as remote.
no setterinherited
isResourceReference → bool
Whether this instance represents a resource value returned over RPC.
finalinherited
location ↔ Output<String>
The location for the resource.
latefinal
name ↔ Output<String>
Output only. The resource name of the pool. Format: locations/{location}/workforcePools/{workforcePoolId}
latefinal
parent ↔ Output<String>
Immutable. The resource name of the parent. Format: organizations/{org-id}.
latefinal
resourceTransforms → List<ResourceTransform>
Inherited/explicit async transforms.
no setterinherited
runtimeType → Type
A representation of the runtime type of the object.
no setterinherited
sessionDuration ↔ Output<String?>
Duration that the Google Cloud access tokens, console sign-in sessions, and gcloud sign-in sessions from this pool are valid. Must be greater than 15 minutes (900s) and less than 12 hours (43200s). If sessionDuration is not configured, minted credentials have a default duration of one hour (3600s). A duration in seconds with up to nine fractional digits, ending with 's'. Example: "3.5s".
latefinal
state ↔ Output<String>
Output only. The state of the pool.
latefinal
transformations → List<ResourceTransformation>
Inherited/explicit legacy transformations.
no setterinherited
urn ↔ Output<String>
latefinalinherited
workforcePoolId ↔ Output<String>
The name of the pool. The ID must be a globally unique string of 6 to 63 lowercase letters, digits, or hyphens. It must start with a letter, and cannot have a trailing hyphen. The prefix gcp- is reserved for use by Google, and may not be specified.
latefinal

Methods

failId(Object error) → void
Completes this resource ID with an error when registration fails.
inherited
failOutputs(Object error) → void
Completes all output properties with error.
inherited
failUrn(Object error) → void
Completes this resource URN with an error when registration fails.
inherited
getProvider(String moduleMember) → ProviderResource?
Returns provider for moduleMember's package, if configured.
inherited
getResourceName() → String
Returns this resource's logical name.
inherited
getResourceType() → String
Returns this resource's Pulumi type token.
inherited
noSuchMethod(Invocation invocation) → dynamic
Invoked when a nonexistent method or property is accessed.
inherited
registerOutput<T>(String propertyName, {Object? decoder(Object?)?, bool isSecret = false}) → Output<T>
Registers a dynamic output property for this resource.
inherited
resolveId(String? value, {required bool isKnown}) → void
Resolves the provider-assigned ID for this resource.
inherited
resolveOutputs(Struct outputs) → void
Resolves all output properties from a monitor response payload.
inherited
resolveUrn(String value) → void
Resolves this resource's URN once assigned by the engine.
inherited
serializeProperties(Map<String, dynamic> properties) → Future<Struct>
Serializes resource properties for RPC transmission.
inherited
toString() → String
A string representation of this object.
inherited

Operators

operator ==(Object other) → bool
The equality operator.
inherited

Static Methods

get(String name, Input<String> id, {WorkforcePoolState? state, CustomResourceOptions? options}) → WorkforcePool
Gets an existing WorkforcePool resource's state with the given name and id.