Manage GCP Dataplex Task IAM Permissions

The gcp:dataplex/taskIamMember:TaskIamMember resource, part of the Pulumi GCP provider, manages IAM permissions for Dataplex tasks by adding individual members to roles without affecting other permissions. This guide focuses on three capabilities: single-member role grants, role-level member management, and full policy replacement.

IAM resources for Dataplex tasks come in three variants with different authoritativeness levels. TaskIamMember is non-authoritative (preserves other members), TaskIamBinding is authoritative for a single role (replaces all members for that role), and TaskIamPolicy is authoritative for the entire policy (replaces all roles and members). TaskIamPolicy cannot be used with the other two resources, as they will conflict. The examples are intentionally small. Combine them with your own task references and identity management strategy.

Grant a single user access to a task

Most IAM configurations add individual users or service accounts to specific resources without disrupting existing permissions.

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

const member = new gcp.dataplex.TaskIamMember("member", {
    project: example.project,
    location: example.location,
    lake: example.lake,
    taskId: example.taskId,
    role: "roles/viewer",
    member: "user:jane@example.com",
});
import pulumi
import pulumi_gcp as gcp

member = gcp.dataplex.TaskIamMember("member",
    project=example["project"],
    location=example["location"],
    lake=example["lake"],
    task_id=example["taskId"],
    role="roles/viewer",
    member="user:jane@example.com")
package main

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

func main() {
	pulumi.Run(func(ctx *pulumi.Context) error {
		_, err := dataplex.NewTaskIamMember(ctx, "member", &dataplex.TaskIamMemberArgs{
			Project:  pulumi.Any(example.Project),
			Location: pulumi.Any(example.Location),
			Lake:     pulumi.Any(example.Lake),
			TaskId:   pulumi.Any(example.TaskId),
			Role:     pulumi.String("roles/viewer"),
			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.DataPlex.TaskIamMember("member", new()
    {
        Project = example.Project,
        Location = example.Location,
        Lake = example.Lake,
        TaskId = example.TaskId,
        Role = "roles/viewer",
        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.dataplex.TaskIamMember;
import com.pulumi.gcp.dataplex.TaskIamMemberArgs;
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 TaskIamMember("member", TaskIamMemberArgs.builder()
            .project(example.project())
            .location(example.location())
            .lake(example.lake())
            .taskId(example.taskId())
            .role("roles/viewer")
            .member("user:jane@example.com")
            .build());

    }
}
resources:
  member:
    type: gcp:dataplex:TaskIamMember
    properties:
      project: ${example.project}
      location: ${example.location}
      lake: ${example.lake}
      taskId: ${example.taskId}
      role: roles/viewer
      member: user:jane@example.com

The member property specifies the identity to grant access, using formats like “user:jane@example.com” or “serviceAccount:app@project.iam.gserviceaccount.com”. The role property defines the permission level. TaskIamMember is non-authoritative, meaning it adds this member without removing others who already have the same role or different roles on the task.

Grant a role to multiple members at once

When multiple identities need the same access level, TaskIamBinding manages all members for a role as a group.

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

const binding = new gcp.dataplex.TaskIamBinding("binding", {
    project: example.project,
    location: example.location,
    lake: example.lake,
    taskId: example.taskId,
    role: "roles/viewer",
    members: ["user:jane@example.com"],
});
import pulumi
import pulumi_gcp as gcp

binding = gcp.dataplex.TaskIamBinding("binding",
    project=example["project"],
    location=example["location"],
    lake=example["lake"],
    task_id=example["taskId"],
    role="roles/viewer",
    members=["user:jane@example.com"])
package main

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

func main() {
	pulumi.Run(func(ctx *pulumi.Context) error {
		_, err := dataplex.NewTaskIamBinding(ctx, "binding", &dataplex.TaskIamBindingArgs{
			Project:  pulumi.Any(example.Project),
			Location: pulumi.Any(example.Location),
			Lake:     pulumi.Any(example.Lake),
			TaskId:   pulumi.Any(example.TaskId),
			Role:     pulumi.String("roles/viewer"),
			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.DataPlex.TaskIamBinding("binding", new()
    {
        Project = example.Project,
        Location = example.Location,
        Lake = example.Lake,
        TaskId = example.TaskId,
        Role = "roles/viewer",
        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.dataplex.TaskIamBinding;
import com.pulumi.gcp.dataplex.TaskIamBindingArgs;
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 TaskIamBinding("binding", TaskIamBindingArgs.builder()
            .project(example.project())
            .location(example.location())
            .lake(example.lake())
            .taskId(example.taskId())
            .role("roles/viewer")
            .members("user:jane@example.com")
            .build());

    }
}
resources:
  binding:
    type: gcp:dataplex:TaskIamBinding
    properties:
      project: ${example.project}
      location: ${example.location}
      lake: ${example.lake}
      taskId: ${example.taskId}
      role: roles/viewer
      members:
        - user:jane@example.com

The members property takes a list of identities. TaskIamBinding is authoritative for the specified role, replacing any existing members for that role while preserving other roles on the task. You can use TaskIamBinding with TaskIamMember as long as they don’t grant the same role.

Replace the entire IAM policy for a task

Some workflows require complete control over all IAM bindings, replacing any existing policy.

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

const admin = gcp.organizations.getIAMPolicy({
    bindings: [{
        role: "roles/viewer",
        members: ["user:jane@example.com"],
    }],
});
const policy = new gcp.dataplex.TaskIamPolicy("policy", {
    project: example.project,
    location: example.location,
    lake: example.lake,
    taskId: example.taskId,
    policyData: admin.then(admin => admin.policyData),
});
import pulumi
import pulumi_gcp as gcp

admin = gcp.organizations.get_iam_policy(bindings=[{
    "role": "roles/viewer",
    "members": ["user:jane@example.com"],
}])
policy = gcp.dataplex.TaskIamPolicy("policy",
    project=example["project"],
    location=example["location"],
    lake=example["lake"],
    task_id=example["taskId"],
    policy_data=admin.policy_data)
package main

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

func main() {
	pulumi.Run(func(ctx *pulumi.Context) error {
		admin, err := organizations.LookupIAMPolicy(ctx, &organizations.LookupIAMPolicyArgs{
			Bindings: []organizations.GetIAMPolicyBinding{
				{
					Role: "roles/viewer",
					Members: []string{
						"user:jane@example.com",
					},
				},
			},
		}, nil)
		if err != nil {
			return err
		}
		_, err = dataplex.NewTaskIamPolicy(ctx, "policy", &dataplex.TaskIamPolicyArgs{
			Project:    pulumi.Any(example.Project),
			Location:   pulumi.Any(example.Location),
			Lake:       pulumi.Any(example.Lake),
			TaskId:     pulumi.Any(example.TaskId),
			PolicyData: pulumi.String(admin.PolicyData),
		})
		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 admin = Gcp.Organizations.GetIAMPolicy.Invoke(new()
    {
        Bindings = new[]
        {
            new Gcp.Organizations.Inputs.GetIAMPolicyBindingInputArgs
            {
                Role = "roles/viewer",
                Members = new[]
                {
                    "user:jane@example.com",
                },
            },
        },
    });

    var policy = new Gcp.DataPlex.TaskIamPolicy("policy", new()
    {
        Project = example.Project,
        Location = example.Location,
        Lake = example.Lake,
        TaskId = example.TaskId,
        PolicyData = admin.Apply(getIAMPolicyResult => getIAMPolicyResult.PolicyData),
    });

});
package generated_program;

import com.pulumi.Context;
import com.pulumi.Pulumi;
import com.pulumi.core.Output;
import com.pulumi.gcp.organizations.OrganizationsFunctions;
import com.pulumi.gcp.organizations.inputs.GetIAMPolicyArgs;
import com.pulumi.gcp.dataplex.TaskIamPolicy;
import com.pulumi.gcp.dataplex.TaskIamPolicyArgs;
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) {
        final var admin = OrganizationsFunctions.getIAMPolicy(GetIAMPolicyArgs.builder()
            .bindings(GetIAMPolicyBindingArgs.builder()
                .role("roles/viewer")
                .members("user:jane@example.com")
                .build())
            .build());

        var policy = new TaskIamPolicy("policy", TaskIamPolicyArgs.builder()
            .project(example.project())
            .location(example.location())
            .lake(example.lake())
            .taskId(example.taskId())
            .policyData(admin.policyData())
            .build());

    }
}
resources:
  policy:
    type: gcp:dataplex:TaskIamPolicy
    properties:
      project: ${example.project}
      location: ${example.location}
      lake: ${example.lake}
      taskId: ${example.taskId}
      policyData: ${admin.policyData}
variables:
  admin:
    fn::invoke:
      function: gcp:organizations:getIAMPolicy
      arguments:
        bindings:
          - role: roles/viewer
            members:
              - user:jane@example.com

TaskIamPolicy uses policyData from getIAMPolicy to define all roles and members in one declaration. The bindings array specifies each role and its members. This resource is authoritative for the entire policy, removing any roles or members not included in the declaration. It cannot be used alongside TaskIamBinding or TaskIamMember.

Beyond these examples

These snippets focus on specific IAM management approaches: single-member grants, role-level member management, and full policy replacement. They’re intentionally minimal rather than complete access control configurations.

The examples reference pre-existing infrastructure such as Dataplex tasks (identified by taskId, lake, location, and project). They focus on configuring IAM permissions rather than provisioning the tasks themselves.

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

  • Conditional IAM bindings (condition property)
  • Custom role definitions and formatting
  • Federated identity configuration
  • Mixing resource types (TaskIamPolicy conflicts with others)

These omissions are intentional: the goal is to illustrate how each IAM resource type is wired, not provide drop-in access control modules. See the Dataplex TaskIamMember resource reference for all available configuration options.

Let's manage GCP Dataplex Task IAM Permissions

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
Why am I getting IAM policy conflicts with my Dataplex Task?
gcp.dataplex.TaskIamPolicy cannot be used with gcp.dataplex.TaskIamBinding or gcp.dataplex.TaskIamMember because they’ll conflict over the policy. Use TaskIamPolicy alone for full control, or use TaskIamBinding and TaskIamMember together (but not TaskIamPolicy).
What's the difference between TaskIamPolicy, TaskIamBinding, and TaskIamMember?
TaskIamPolicy is authoritative and replaces the entire IAM policy. TaskIamBinding is authoritative for a specific role, replacing all members for that role while preserving other roles. TaskIamMember is non-authoritative, adding a single member to a role while preserving other members.
Can I use TaskIamBinding and TaskIamMember together?
Yes, but only if they manage different roles. If both resources grant the same role, they’ll conflict.
IAM Configuration
What member identity formats are supported?
You can use allUsers, allAuthenticatedUsers, user:{emailid}, serviceAccount:{emailid}, group:{emailid}, domain:{domain}, projectOwner:projectid, projectEditor:projectid, projectViewer:projectid, or federated identities (e.g., principal://iam.googleapis.com/...).
How do I specify custom roles?
Custom roles must use the format [projects|organizations]/{parent-name}/roles/{role-name}. For example, projects/my-project/roles/my-custom-role.
Can I change the role or member after creating a TaskIamMember?
No, all properties (lake, location, member, project, role, taskId) are immutable and require resource replacement if changed.

Using a different cloud?

Explore security guides for other cloud providers: