The gcp:dataplex/zoneIamBinding:ZoneIamBinding resource, part of the Pulumi GCP provider, grants IAM roles to members for Dataplex zones, controlling who can access and manage zone resources. This guide focuses on two capabilities: authoritative role binding for multiple members and non-authoritative member addition.
ZoneIamBinding is one of three IAM resources for Dataplex zones. ZoneIamBinding is authoritative for a given role, meaning it replaces all members for that role. ZoneIamMember is non-authoritative, adding individual members without affecting others. ZoneIamPolicy is fully authoritative and cannot be used alongside the other two. The examples are intentionally small. Combine them with your own Dataplex infrastructure and identity management.
Grant a role to multiple members
Teams managing zones 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.ZoneIamBinding("binding", {
project: example.project,
location: example.location,
lake: example.lake,
dataplexZone: example.name,
role: "roles/viewer",
members: ["user:jane@example.com"],
});
import pulumi
import pulumi_gcp as gcp
binding = gcp.dataplex.ZoneIamBinding("binding",
project=example["project"],
location=example["location"],
lake=example["lake"],
dataplex_zone=example["name"],
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.NewZoneIamBinding(ctx, "binding", &dataplex.ZoneIamBindingArgs{
Project: pulumi.Any(example.Project),
Location: pulumi.Any(example.Location),
Lake: pulumi.Any(example.Lake),
DataplexZone: pulumi.Any(example.Name),
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.ZoneIamBinding("binding", new()
{
Project = example.Project,
Location = example.Location,
Lake = example.Lake,
DataplexZone = example.Name,
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.ZoneIamBinding;
import com.pulumi.gcp.dataplex.ZoneIamBindingArgs;
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 ZoneIamBinding("binding", ZoneIamBindingArgs.builder()
.project(example.project())
.location(example.location())
.lake(example.lake())
.dataplexZone(example.name())
.role("roles/viewer")
.members("user:jane@example.com")
.build());
}
}
resources:
binding:
type: gcp:dataplex:ZoneIamBinding
properties:
project: ${example.project}
location: ${example.location}
lake: ${example.lake}
dataplexZone: ${example.name}
role: roles/viewer
members:
- user:jane@example.com
The role property specifies which IAM role to grant (e.g., “roles/viewer”). The members array lists all identities that should receive this role. This binding is authoritative for the specified role, replacing any existing members for that role on the zone. The dataplexZone, lake, and location properties identify which zone to configure.
Add a single member to a role
When onboarding individual users or service accounts, you can add them to existing roles without affecting other members.
import * as pulumi from "@pulumi/pulumi";
import * as gcp from "@pulumi/gcp";
const member = new gcp.dataplex.ZoneIamMember("member", {
project: example.project,
location: example.location,
lake: example.lake,
dataplexZone: example.name,
role: "roles/viewer",
member: "user:jane@example.com",
});
import pulumi
import pulumi_gcp as gcp
member = gcp.dataplex.ZoneIamMember("member",
project=example["project"],
location=example["location"],
lake=example["lake"],
dataplex_zone=example["name"],
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.NewZoneIamMember(ctx, "member", &dataplex.ZoneIamMemberArgs{
Project: pulumi.Any(example.Project),
Location: pulumi.Any(example.Location),
Lake: pulumi.Any(example.Lake),
DataplexZone: pulumi.Any(example.Name),
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.ZoneIamMember("member", new()
{
Project = example.Project,
Location = example.Location,
Lake = example.Lake,
DataplexZone = example.Name,
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.ZoneIamMember;
import com.pulumi.gcp.dataplex.ZoneIamMemberArgs;
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 ZoneIamMember("member", ZoneIamMemberArgs.builder()
.project(example.project())
.location(example.location())
.lake(example.lake())
.dataplexZone(example.name())
.role("roles/viewer")
.member("user:jane@example.com")
.build());
}
}
resources:
member:
type: gcp:dataplex:ZoneIamMember
properties:
project: ${example.project}
location: ${example.location}
lake: ${example.lake}
dataplexZone: ${example.name}
role: roles/viewer
member: user:jane@example.com
The member property specifies a single identity to grant the role. Unlike ZoneIamBinding, ZoneIamMember is non-authoritative: it adds this member to the role without removing existing members. This approach works well for incremental access grants where you don’t want to manage the complete member list.
Beyond these examples
These snippets focus on specific zone IAM features: role-based access control and authoritative and non-authoritative member management. They’re intentionally minimal rather than full access control configurations.
The examples reference pre-existing infrastructure such as Dataplex zones, lakes, and projects. They focus on configuring IAM bindings rather than provisioning the underlying Dataplex resources.
To keep things focused, common IAM patterns are omitted, including:
- Conditional IAM bindings (condition property)
- Policy-level management (ZoneIamPolicy resource)
- Custom role definitions
- Federated identity configuration
These omissions are intentional: the goal is to illustrate how zone IAM bindings are wired, not provide drop-in access control modules. See the Dataplex ZoneIamBinding resource reference for all available configuration options.
Let's manage GCP Dataplex Zone 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
gcp.dataplex.ZoneIamPolicy cannot be used with gcp.dataplex.ZoneIamBinding or gcp.dataplex.ZoneIamMember because they will conflict over the IAM policy. Use ZoneIamPolicy alone for full policy control, or use ZoneIamBinding/ZoneIamMember together for incremental changes.gcp.dataplex.ZoneIamBinding and gcp.dataplex.ZoneIamMember will conflict if they both grant privileges to the same role.gcp.dataplex.ZoneIamPolicy replaces the entire IAM policy (authoritative), gcp.dataplex.ZoneIamBinding manages all members for a specific role (authoritative per role), or gcp.dataplex.ZoneIamMember adds individual members without affecting others (non-authoritative).Configuration & Formats
[projects|organizations]/{parent-name}/roles/{role-name}, such as projects/my-project/roles/my-custom-role or organizations/my-org/roles/my-custom-role.allUsers, allAuthenticatedUsers, user:{email}, serviceAccount:{email}, group:{email}, domain:{domain}, projectOwner:{projectid}, projectEditor:{projectid}, projectViewer:{projectid}, and federated identities like principal://iam.googleapis.com/....role property is immutable and cannot be changed after creation. You must delete and recreate the resource to change roles.