The gcp:dataplex/taskIamBinding:TaskIamBinding resource, part of the Pulumi GCP provider, manages IAM role bindings for Dataplex tasks by granting a specific role to a list of members. This guide focuses on two capabilities: authoritative role binding (which replaces all members for a role) and non-authoritative member addition (which preserves existing members).
This resource references existing Dataplex tasks. GCP provides three IAM resources for tasks: TaskIamPolicy (full policy replacement), TaskIamBinding (authoritative for one role), and TaskIamMember (non-authoritative for one member). TaskIamPolicy cannot be used with TaskIamBinding or TaskIamMember, as they will conflict. TaskIamBinding and TaskIamMember can coexist only if they manage different roles. The examples are intentionally small. Combine them with your own task infrastructure and access requirements.
Grant a role to multiple members
Teams managing Dataplex tasks often need to grant the same role to multiple users or service accounts at once, such as giving viewer access to a data engineering team.
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 TaskIamBinding resource is authoritative for the specified role: it replaces all members for that role on the task. The members array accepts user accounts, service accounts, groups, and domain identifiers. The taskId, lake, location, and project properties identify which Dataplex task receives the binding. If you add or remove members from this resource, GCP updates the role binding to match exactly what you specify.
Add a single member to a role
When onboarding individual users or service accounts, you often need to grant access without affecting existing members of the same role.
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 TaskIamMember resource is non-authoritative: it adds one member to a role without replacing existing members. Use this when multiple teams or systems manage access to the same task, or when you want to grant access incrementally. The member property accepts a single identity in the same formats as the members array (user:, serviceAccount:, group:, etc.). Unlike TaskIamBinding, multiple TaskIamMember resources can target the same role without conflict.
Beyond these examples
These snippets focus on specific IAM binding features: role-based access control and authoritative vs non-authoritative member management. They’re intentionally minimal rather than full 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 bindings rather than provisioning the tasks themselves.
To keep things focused, common IAM patterns are omitted, including:
- Conditional IAM bindings (condition property)
- Full policy replacement (TaskIamPolicy resource)
- Custom role formatting ([projects|organizations]/{parent}/roles/{name})
- Federated identity principals
These omissions are intentional: the goal is to illustrate how each IAM binding approach is wired, not provide drop-in access control modules. See the Dataplex TaskIamBinding resource reference for all available configuration options.
Let's manage GCP Dataplex Task IAM Bindings
Get started with Pulumi Cloud, then follow our quick setup guide to deploy this infrastructure.
Try Pulumi Cloud for FREEFrequently Asked Questions
Resource Selection & Conflicts
TaskIamPolicy is authoritative and replaces the entire IAM policy. TaskIamBinding is authoritative for a specific role, preserving other roles. TaskIamMember is non-authoritative, adding a single member while preserving other members for that role.TaskIamPolicy cannot be used alongside TaskIamBinding or TaskIamMember because they’ll conflict over the IAM policy.Configuration & Identity Formats
allUsers, allAuthenticatedUsers, user:{email}, serviceAccount:{email}, group:{email}, domain:{domain}, projectOwner/Editor/Viewer:{projectid}, and federated identities like principal://iam.googleapis.com/....[projects|organizations]/{parent-name}/roles/{role-name}.Immutability & Constraints
role, lake, location, taskId, project, and condition properties are all immutable.