The gcp:dataplex/lakeIamBinding:LakeIamBinding resource, part of the Pulumi GCP provider, manages IAM role bindings for Dataplex lakes. It provides authoritative control over which identities have a specific role. This guide focuses on two capabilities: binding a role to multiple members and adding single members non-authoritatively.
IAM bindings reference existing Dataplex lakes by name, location, and project. The examples are intentionally small. Combine them with your own lake infrastructure and identity management.
Grant a role to multiple members
Teams managing lakes often need to grant the same role to multiple users or service accounts at once.
import * as pulumi from "@pulumi/pulumi";
import * as gcp from "@pulumi/gcp";
const binding = new gcp.dataplex.LakeIamBinding("binding", {
project: example.project,
location: example.location,
lake: example.name,
role: "roles/viewer",
members: ["user:jane@example.com"],
});
import pulumi
import pulumi_gcp as gcp
binding = gcp.dataplex.LakeIamBinding("binding",
project=example["project"],
location=example["location"],
lake=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.NewLakeIamBinding(ctx, "binding", &dataplex.LakeIamBindingArgs{
Project: pulumi.Any(example.Project),
Location: pulumi.Any(example.Location),
Lake: 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.LakeIamBinding("binding", new()
{
Project = example.Project,
Location = example.Location,
Lake = 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.LakeIamBinding;
import com.pulumi.gcp.dataplex.LakeIamBindingArgs;
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 LakeIamBinding("binding", LakeIamBindingArgs.builder()
.project(example.project())
.location(example.location())
.lake(example.name())
.role("roles/viewer")
.members("user:jane@example.com")
.build());
}
}
resources:
binding:
type: gcp:dataplex:LakeIamBinding
properties:
project: ${example.project}
location: ${example.location}
lake: ${example.name}
role: roles/viewer
members:
- user:jane@example.com
The role property specifies which permission set to grant. The members array lists all identities that should have this role; LakeIamBinding replaces any existing members for this role while preserving other roles on the lake. Each member follows the format user:{email}, serviceAccount:{email}, group:{email}, or special identifiers like allUsers.
Add a single member to a role
When you need to grant access to one additional user without affecting existing members, use LakeIamMember for non-authoritative updates.
import * as pulumi from "@pulumi/pulumi";
import * as gcp from "@pulumi/gcp";
const member = new gcp.dataplex.LakeIamMember("member", {
project: example.project,
location: example.location,
lake: example.name,
role: "roles/viewer",
member: "user:jane@example.com",
});
import pulumi
import pulumi_gcp as gcp
member = gcp.dataplex.LakeIamMember("member",
project=example["project"],
location=example["location"],
lake=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.NewLakeIamMember(ctx, "member", &dataplex.LakeIamMemberArgs{
Project: pulumi.Any(example.Project),
Location: pulumi.Any(example.Location),
Lake: 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.LakeIamMember("member", new()
{
Project = example.Project,
Location = example.Location,
Lake = 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.LakeIamMember;
import com.pulumi.gcp.dataplex.LakeIamMemberArgs;
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 LakeIamMember("member", LakeIamMemberArgs.builder()
.project(example.project())
.location(example.location())
.lake(example.name())
.role("roles/viewer")
.member("user:jane@example.com")
.build());
}
}
resources:
member:
type: gcp:dataplex:LakeIamMember
properties:
project: ${example.project}
location: ${example.location}
lake: ${example.name}
role: roles/viewer
member: user:jane@example.com
The member property specifies a single identity to add. Unlike LakeIamBinding, LakeIamMember preserves existing members for the same role, making it safe to use when other tools or team members manage the same role. This is an alternative to LakeIamBinding when you want additive rather than authoritative updates.
Beyond these examples
These snippets focus on specific IAM binding features: authoritative role binding and non-authoritative member addition. They’re intentionally minimal rather than full access control configurations.
The examples reference pre-existing infrastructure such as Dataplex lakes (by name, location, and project). They focus on configuring IAM bindings rather than provisioning the lakes themselves.
To keep things focused, common IAM patterns are omitted, including:
- Conditional IAM bindings (condition property)
- Full policy replacement (LakeIamPolicy resource)
- Custom role formatting ([projects|organizations]/{parent}/roles/{name})
- Federated identity principals and workload identity
These omissions are intentional: the goal is to illustrate how IAM bindings are wired, not provide drop-in access control modules. See the Dataplex LakeIamBinding resource reference for all available configuration options.
Let's manage GCP Dataplex Lake IAM Permissions
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.LakeIamPolicy is authoritative and replaces the entire IAM policy. gcp.dataplex.LakeIamBinding is authoritative for a specific role, replacing all members for that role while preserving other roles. gcp.dataplex.LakeIamMember is non-authoritative and adds a single member to a role without affecting other members.gcp.dataplex.LakeIamPolicy cannot be used with gcp.dataplex.LakeIamBinding or gcp.dataplex.LakeIamMember because they will conflict over the IAM policy.Configuration & Identity Management
allUsers, allAuthenticatedUsers, user:{email}, serviceAccount:{email}, group:{email}, domain:{domain}, projectOwner/Editor/Viewer:{projectid}, and federated identities like principal://iam.googleapis.com/locations/global/workforcePools/....[projects|organizations]/{parent-name}/roles/{role-name}, such as projects/my-project/roles/my-custom-role.location and project can be parsed from the parent lake resource identifier or taken from the provider configuration if not specified.Immutability & Updates
lake, location, project, role, and condition properties are all immutable. Only the members list can be updated after creation.