Manage GCP Dataplex Zone IAM Permissions

The gcp:dataplex/zoneIamMember:ZoneIamMember resource, part of the Pulumi GCP provider, manages IAM permissions for Dataplex zones, controlling who can access zone resources and with what privileges. This guide focuses on three approaches to IAM management: policy replacement, role binding, and member addition.

These three resources (ZoneIamPolicy, ZoneIamBinding, ZoneIamMember) reference existing Dataplex zones and IAM principals. The examples are intentionally small. Combine them with your own zone infrastructure and identity management.

Replace the entire IAM policy for a zone

When you need complete control over zone access, you can set the entire IAM policy at once, replacing any existing permissions.

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.ZoneIamPolicy("policy", {
    project: example.project,
    location: example.location,
    lake: example.lake,
    dataplexZone: example.name,
    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.ZoneIamPolicy("policy",
    project=example["project"],
    location=example["location"],
    lake=example["lake"],
    dataplex_zone=example["name"],
    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.NewZoneIamPolicy(ctx, "policy", &dataplex.ZoneIamPolicyArgs{
			Project:      pulumi.Any(example.Project),
			Location:     pulumi.Any(example.Location),
			Lake:         pulumi.Any(example.Lake),
			DataplexZone: pulumi.Any(example.Name),
			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.ZoneIamPolicy("policy", new()
    {
        Project = example.Project,
        Location = example.Location,
        Lake = example.Lake,
        DataplexZone = example.Name,
        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.ZoneIamPolicy;
import com.pulumi.gcp.dataplex.ZoneIamPolicyArgs;
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 ZoneIamPolicy("policy", ZoneIamPolicyArgs.builder()
            .project(example.project())
            .location(example.location())
            .lake(example.lake())
            .dataplexZone(example.name())
            .policyData(admin.policyData())
            .build());

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

The ZoneIamPolicy resource is authoritative: it replaces all existing IAM bindings on the zone. The policyData comes from getIAMPolicy, which defines bindings (role and members pairs). Any permissions not included in policyData are removed when this resource is applied.

Grant a role to multiple members at once

When multiple users or service accounts need the same role, you can bind them all in a single resource.

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 ZoneIamBinding resource is authoritative for one specific role: it replaces all members for that role while preserving other roles on the zone. The members property accepts a list of identity strings. This approach works well when you manage all members of a role together.

Add a single member to a role incrementally

When you need to grant access to one identity without affecting other members, you can add them individually.

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 ZoneIamMember resource is non-authoritative: it adds one member to a role without removing others. The member property accepts a single identity string. You can safely use multiple ZoneIamMember resources for the same role, as long as they grant to different members.

Beyond these examples

These snippets focus on specific IAM management features: authoritative vs non-authoritative IAM management, and policy-level, role-level, and member-level grants. They’re intentionally minimal rather than full access control configurations.

The examples reference pre-existing infrastructure such as Dataplex zones (project, location, lake, zone name) and IAM principals (users, service accounts, groups). They focus on configuring IAM permissions rather than provisioning the zones themselves.

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

  • Conditional IAM bindings (condition property)
  • Custom role definitions
  • Federated identity configuration
  • Resource conflicts between Policy, Binding, and Member resources

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

Let's manage GCP Dataplex Zone 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
What's the difference between ZoneIamPolicy, ZoneIamBinding, and ZoneIamMember?
ZoneIamPolicy is authoritative and replaces the entire IAM policy. ZoneIamBinding is authoritative for a specific role, replacing all members for that role while preserving other roles. ZoneIamMember is non-authoritative and adds a single member without affecting other members or roles.
Can I use ZoneIamPolicy with ZoneIamBinding or ZoneIamMember?
No, ZoneIamPolicy cannot be used with ZoneIamBinding or ZoneIamMember because they will conflict over the policy configuration.
Can I use ZoneIamBinding and ZoneIamMember together?
Yes, but only if they manage different roles. Using both for the same role will cause conflicts.
Configuration & Formats
What member identity formats are supported?
Supported formats include allUsers, allAuthenticatedUsers, user:{emailid}, serviceAccount:{emailid}, group:{emailid}, domain:{domain}, projectOwner:projectid, projectEditor:projectid, projectViewer:projectid, and federated identities like principal://iam.googleapis.com/....
How do I specify a custom IAM role?
Custom roles must use the format [projects|organizations]/{parent-name}/roles/{role-name}, such as projects/my-project/roles/my-custom-role.
How do I grant access to all users on the internet?
Use allUsers as the member value to grant access to anyone, with or without a Google account.
Immutability & Lifecycle
What properties can't be changed after creation?
All properties are immutable: dataplexZone, lake, location, project, member, role, and condition. Changing any of these requires recreating the resource.
Can I change which member has access to a role?
No, the member property is immutable. You must delete and recreate the ZoneIamMember resource to change the member identity.

Using a different cloud?

Explore security guides for other cloud providers: