Configure GCP Workload Identity Pool IAM Bindings

The gcp:iam/workloadIdentityPoolIamBinding:WorkloadIdentityPoolIamBinding resource, part of the Pulumi GCP provider, manages IAM role bindings for Workload Identity Pools, controlling which identities can access the pool. This guide focuses on three capabilities: authoritative role binding for multiple members, time-based conditional access, and non-authoritative member addition.

Workload Identity Pool IAM resources reference existing pools and work alongside two related resources: IamPolicy (replaces entire policy) and IamMember (adds single members). The examples are intentionally small. Combine them with your own pool configuration and identity management strategy.

Grant a role to multiple members with IamBinding

Teams managing pool access often need to grant the same role to multiple users or service accounts simultaneously.

import * as pulumi from "@pulumi/pulumi";
import * as gcp from "@pulumi/gcp";

const binding = new gcp.iam.WorkloadIdentityPoolIamBinding("binding", {
    project: example.project,
    workloadIdentityPoolId: example.workloadIdentityPoolId,
    role: "roles/iam.workloadIdentityPoolViewer",
    members: ["user:jane@example.com"],
});
import pulumi
import pulumi_gcp as gcp

binding = gcp.iam.WorkloadIdentityPoolIamBinding("binding",
    project=example["project"],
    workload_identity_pool_id=example["workloadIdentityPoolId"],
    role="roles/iam.workloadIdentityPoolViewer",
    members=["user:jane@example.com"])
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.NewWorkloadIdentityPoolIamBinding(ctx, "binding", &iam.WorkloadIdentityPoolIamBindingArgs{
			Project:                pulumi.Any(example.Project),
			WorkloadIdentityPoolId: pulumi.Any(example.WorkloadIdentityPoolId),
			Role:                   pulumi.String("roles/iam.workloadIdentityPoolViewer"),
			Members: pulumi.StringArray{
				pulumi.String("user:jane@example.com"),
			},
		})
		if err != nil {
			return err
		}
		return nil
	})
}
using System.Collections.Generic;
using System.Linq;
using Pulumi;
using Gcp = Pulumi.Gcp;

return await Deployment.RunAsync(() => 
{
    var binding = new Gcp.Iam.WorkloadIdentityPoolIamBinding("binding", new()
    {
        Project = example.Project,
        WorkloadIdentityPoolId = example.WorkloadIdentityPoolId,
        Role = "roles/iam.workloadIdentityPoolViewer",
        Members = new[]
        {
            "user:jane@example.com",
        },
    });

});
package generated_program;

import com.pulumi.Context;
import com.pulumi.Pulumi;
import com.pulumi.core.Output;
import com.pulumi.gcp.iam.WorkloadIdentityPoolIamBinding;
import com.pulumi.gcp.iam.WorkloadIdentityPoolIamBindingArgs;
import java.util.List;
import java.util.ArrayList;
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 binding = new WorkloadIdentityPoolIamBinding("binding", WorkloadIdentityPoolIamBindingArgs.builder()
            .project(example.project())
            .workloadIdentityPoolId(example.workloadIdentityPoolId())
            .role("roles/iam.workloadIdentityPoolViewer")
            .members("user:jane@example.com")
            .build());

    }
}
resources:
  binding:
    type: gcp:iam:WorkloadIdentityPoolIamBinding
    properties:
      project: ${example.project}
      workloadIdentityPoolId: ${example.workloadIdentityPoolId}
      role: roles/iam.workloadIdentityPoolViewer
      members:
        - user:jane@example.com

The IamBinding resource is authoritative for the specified role. The members array lists all identities that should have this role; any existing members not in this list will be removed. The workloadIdentityPoolId identifies which pool to configure. This approach works well when you want complete control over who has a specific role.

Add time-based access with IAM Conditions

Access requirements sometimes include temporal constraints, like permissions that expire after a project deadline.

import * as pulumi from "@pulumi/pulumi";
import * as gcp from "@pulumi/gcp";

const binding = new gcp.iam.WorkloadIdentityPoolIamBinding("binding", {
    project: example.project,
    workloadIdentityPoolId: example.workloadIdentityPoolId,
    role: "roles/iam.workloadIdentityPoolViewer",
    members: ["user:jane@example.com"],
    condition: {
        title: "expires_after_2019_12_31",
        description: "Expiring at midnight of 2019-12-31",
        expression: "request.time < timestamp(\"2020-01-01T00:00:00Z\")",
    },
});
import pulumi
import pulumi_gcp as gcp

binding = gcp.iam.WorkloadIdentityPoolIamBinding("binding",
    project=example["project"],
    workload_identity_pool_id=example["workloadIdentityPoolId"],
    role="roles/iam.workloadIdentityPoolViewer",
    members=["user:jane@example.com"],
    condition={
        "title": "expires_after_2019_12_31",
        "description": "Expiring at midnight of 2019-12-31",
        "expression": "request.time < timestamp(\"2020-01-01T00:00:00Z\")",
    })
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.NewWorkloadIdentityPoolIamBinding(ctx, "binding", &iam.WorkloadIdentityPoolIamBindingArgs{
			Project:                pulumi.Any(example.Project),
			WorkloadIdentityPoolId: pulumi.Any(example.WorkloadIdentityPoolId),
			Role:                   pulumi.String("roles/iam.workloadIdentityPoolViewer"),
			Members: pulumi.StringArray{
				pulumi.String("user:jane@example.com"),
			},
			Condition: &iam.WorkloadIdentityPoolIamBindingConditionArgs{
				Title:       pulumi.String("expires_after_2019_12_31"),
				Description: pulumi.String("Expiring at midnight of 2019-12-31"),
				Expression:  pulumi.String("request.time < timestamp(\"2020-01-01T00:00:00Z\")"),
			},
		})
		if err != nil {
			return err
		}
		return nil
	})
}
using System.Collections.Generic;
using System.Linq;
using Pulumi;
using Gcp = Pulumi.Gcp;

return await Deployment.RunAsync(() => 
{
    var binding = new Gcp.Iam.WorkloadIdentityPoolIamBinding("binding", new()
    {
        Project = example.Project,
        WorkloadIdentityPoolId = example.WorkloadIdentityPoolId,
        Role = "roles/iam.workloadIdentityPoolViewer",
        Members = new[]
        {
            "user:jane@example.com",
        },
        Condition = new Gcp.Iam.Inputs.WorkloadIdentityPoolIamBindingConditionArgs
        {
            Title = "expires_after_2019_12_31",
            Description = "Expiring at midnight of 2019-12-31",
            Expression = "request.time < timestamp(\"2020-01-01T00:00:00Z\")",
        },
    });

});
package generated_program;

import com.pulumi.Context;
import com.pulumi.Pulumi;
import com.pulumi.core.Output;
import com.pulumi.gcp.iam.WorkloadIdentityPoolIamBinding;
import com.pulumi.gcp.iam.WorkloadIdentityPoolIamBindingArgs;
import com.pulumi.gcp.iam.inputs.WorkloadIdentityPoolIamBindingConditionArgs;
import java.util.List;
import java.util.ArrayList;
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 binding = new WorkloadIdentityPoolIamBinding("binding", WorkloadIdentityPoolIamBindingArgs.builder()
            .project(example.project())
            .workloadIdentityPoolId(example.workloadIdentityPoolId())
            .role("roles/iam.workloadIdentityPoolViewer")
            .members("user:jane@example.com")
            .condition(WorkloadIdentityPoolIamBindingConditionArgs.builder()
                .title("expires_after_2019_12_31")
                .description("Expiring at midnight of 2019-12-31")
                .expression("request.time < timestamp(\"2020-01-01T00:00:00Z\")")
                .build())
            .build());

    }
}
resources:
  binding:
    type: gcp:iam:WorkloadIdentityPoolIamBinding
    properties:
      project: ${example.project}
      workloadIdentityPoolId: ${example.workloadIdentityPoolId}
      role: roles/iam.workloadIdentityPoolViewer
      members:
        - user:jane@example.com
      condition:
        title: expires_after_2019_12_31
        description: Expiring at midnight of 2019-12-31
        expression: request.time < timestamp("2020-01-01T00:00:00Z")

The condition block adds temporal logic to the binding. The expression property uses CEL (Common Expression Language) to define when access is valid; here, request.time checks the current timestamp against a deadline. The title and description document the condition’s purpose. IAM evaluates conditions at request time, automatically denying access once the expression returns false.

Add a single member to a role with IamMember

When you need to grant access to one additional user without affecting existing members, IamMember provides non-authoritative updates.

import * as pulumi from "@pulumi/pulumi";
import * as gcp from "@pulumi/gcp";

const member = new gcp.iam.WorkloadIdentityPoolIamMember("member", {
    project: example.project,
    workloadIdentityPoolId: example.workloadIdentityPoolId,
    role: "roles/iam.workloadIdentityPoolViewer",
    member: "user:jane@example.com",
});
import pulumi
import pulumi_gcp as gcp

member = gcp.iam.WorkloadIdentityPoolIamMember("member",
    project=example["project"],
    workload_identity_pool_id=example["workloadIdentityPoolId"],
    role="roles/iam.workloadIdentityPoolViewer",
    member="user:jane@example.com")
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.NewWorkloadIdentityPoolIamMember(ctx, "member", &iam.WorkloadIdentityPoolIamMemberArgs{
			Project:                pulumi.Any(example.Project),
			WorkloadIdentityPoolId: pulumi.Any(example.WorkloadIdentityPoolId),
			Role:                   pulumi.String("roles/iam.workloadIdentityPoolViewer"),
			Member:                 pulumi.String("user:jane@example.com"),
		})
		if err != nil {
			return err
		}
		return nil
	})
}
using System.Collections.Generic;
using System.Linq;
using Pulumi;
using Gcp = Pulumi.Gcp;

return await Deployment.RunAsync(() => 
{
    var member = new Gcp.Iam.WorkloadIdentityPoolIamMember("member", new()
    {
        Project = example.Project,
        WorkloadIdentityPoolId = example.WorkloadIdentityPoolId,
        Role = "roles/iam.workloadIdentityPoolViewer",
        Member = "user:jane@example.com",
    });

});
package generated_program;

import com.pulumi.Context;
import com.pulumi.Pulumi;
import com.pulumi.core.Output;
import com.pulumi.gcp.iam.WorkloadIdentityPoolIamMember;
import com.pulumi.gcp.iam.WorkloadIdentityPoolIamMemberArgs;
import java.util.List;
import java.util.ArrayList;
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 member = new WorkloadIdentityPoolIamMember("member", WorkloadIdentityPoolIamMemberArgs.builder()
            .project(example.project())
            .workloadIdentityPoolId(example.workloadIdentityPoolId())
            .role("roles/iam.workloadIdentityPoolViewer")
            .member("user:jane@example.com")
            .build());

    }
}
resources:
  member:
    type: gcp:iam:WorkloadIdentityPoolIamMember
    properties:
      project: ${example.project}
      workloadIdentityPoolId: ${example.workloadIdentityPoolId}
      role: roles/iam.workloadIdentityPoolViewer
      member: user:jane@example.com

The IamMember resource adds a single member to a role without replacing others. Unlike IamBinding, this resource preserves existing grants. The member property specifies one identity using the same format as the members array in IamBinding. Use this when multiple teams manage access independently or when you need to add users incrementally.

Beyond these examples

These snippets focus on specific IAM binding features: role binding with multiple members, time-based conditional access, and incremental member addition. They’re intentionally minimal rather than full access control policies.

The examples reference pre-existing infrastructure such as Workload Identity Pools and GCP projects with IAM enabled. They focus on configuring role bindings rather than creating the pools themselves.

To keep things focused, common IAM patterns are omitted, including:

  • Full policy replacement (IamPolicy resource)
  • Custom role definitions and formatting
  • Complex condition expressions (attribute-based, resource-based)
  • Federated identity configuration and principal identifiers

These omissions are intentional: the goal is to illustrate how each binding approach is wired, not provide drop-in access control modules. See the Workload Identity Pool IAM Binding resource reference for all available configuration options.

Let's configure GCP Workload Identity Pool IAM Bindings

Get started with Pulumi Cloud, then follow our quick setup guide to deploy this infrastructure.

Try Pulumi Cloud for FREE

Frequently Asked Questions

Resource Selection & Conflicts
What's the difference between WorkloadIdentityPoolIamPolicy, WorkloadIdentityPoolIamBinding, and WorkloadIdentityPoolIamMember?
WorkloadIdentityPoolIamPolicy is authoritative and replaces the entire IAM policy. WorkloadIdentityPoolIamBinding is authoritative for a specific role but preserves other roles. WorkloadIdentityPoolIamMember is non-authoritative and adds a single member to a role while preserving other members.
Can I use WorkloadIdentityPoolIamPolicy with WorkloadIdentityPoolIamBinding or WorkloadIdentityPoolIamMember?
No, WorkloadIdentityPoolIamPolicy cannot be used with WorkloadIdentityPoolIamBinding or WorkloadIdentityPoolIamMember because they will conflict over the policy configuration.
Can I use WorkloadIdentityPoolIamBinding with WorkloadIdentityPoolIamMember?
Yes, but only if they grant different roles. Using both resources for the same role will cause conflicts.
Configuration & Member Identities
What member identity formats are supported?
Supported formats include user:{email}, serviceAccount:{email}, group:{email}, domain:{domain}, allUsers, allAuthenticatedUsers, projectOwner/Editor/Viewer:{projectid}, and federated identities using principal:// URIs.
What properties can't be changed after creation?
The role, workloadIdentityPoolId, project, and condition properties are immutable and cannot be modified after the resource is created.
Can I use multiple WorkloadIdentityPoolIamBinding resources for the same workload identity pool?
Yes, but only one WorkloadIdentityPoolIamBinding per role. Each binding must grant a different role.
IAM Conditions & Time-Based Access
How do I add time-based access restrictions?
Use the condition property with title, description, and expression fields. For example, set expression to request.time < timestamp("2020-01-01T00:00:00Z") to expire access at a specific time.
What are the limitations of IAM Conditions?
IAM Conditions have known limitations that may affect certain use cases. Review the GCP documentation on IAM Conditions limitations before implementing conditional access.
Import & Custom Roles
How do I import a binding with a custom role?
Use the full custom role path in the format [projects/my-project|organizations/my-org]/roles/my-custom-role. For example: pulumi import gcp:iam/workloadIdentityPoolIamBinding:WorkloadIdentityPoolIamBinding editor "projects/my-project/locations/global/workloadIdentityPools/my-pool projects/my-project/roles/my-custom-role".
What formats can I use to identify the workload identity pool during import?
You can use projects/{{project}}/locations/global/workloadIdentityPools/{{workload_identity_pool_id}}, {{project}}/{{workload_identity_pool_id}}, or just {{workload_identity_pool_id}}. Variables not provided will be taken from the provider configuration.

Using a different cloud?

Explore security guides for other cloud providers: