The gcp:dataplex/glossaryIamPolicy:GlossaryIamPolicy resource, part of the Pulumi GCP provider, manages IAM access control for Dataplex glossaries at three levels: complete policy replacement, role-level binding, or individual member grants. This guide focuses on three capabilities: authoritative policy replacement (GlossaryIamPolicy), role-level member management (GlossaryIamBinding), and incremental member addition (GlossaryIamMember).
These resources reference an existing glossary and have strict conflict rules. GlossaryIamPolicy cannot be used with GlossaryIamBinding or GlossaryIamMember. GlossaryIamBinding and GlossaryIamMember can coexist only if they manage different roles. The examples are intentionally small. Choose the approach that matches your access control needs.
Replace the entire IAM policy for a glossary
When you need complete control over glossary 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.GlossaryIamPolicy("policy", {
project: glossaryTestId.project,
location: glossaryTestId.location,
glossaryId: glossaryTestId.glossaryId,
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.GlossaryIamPolicy("policy",
project=glossary_test_id["project"],
location=glossary_test_id["location"],
glossary_id=glossary_test_id["glossaryId"],
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.NewGlossaryIamPolicy(ctx, "policy", &dataplex.GlossaryIamPolicyArgs{
Project: pulumi.Any(glossaryTestId.Project),
Location: pulumi.Any(glossaryTestId.Location),
GlossaryId: pulumi.Any(glossaryTestId.GlossaryId),
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.GlossaryIamPolicy("policy", new()
{
Project = glossaryTestId.Project,
Location = glossaryTestId.Location,
GlossaryId = glossaryTestId.GlossaryId,
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.GlossaryIamPolicy;
import com.pulumi.gcp.dataplex.GlossaryIamPolicyArgs;
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 GlossaryIamPolicy("policy", GlossaryIamPolicyArgs.builder()
.project(glossaryTestId.project())
.location(glossaryTestId.location())
.glossaryId(glossaryTestId.glossaryId())
.policyData(admin.policyData())
.build());
}
}
resources:
policy:
type: gcp:dataplex:GlossaryIamPolicy
properties:
project: ${glossaryTestId.project}
location: ${glossaryTestId.location}
glossaryId: ${glossaryTestId.glossaryId}
policyData: ${admin.policyData}
variables:
admin:
fn::invoke:
function: gcp:organizations:getIAMPolicy
arguments:
bindings:
- role: roles/viewer
members:
- user:jane@example.com
The policyData property accepts output from the getIAMPolicy data source, which defines bindings between roles and members. This resource is authoritative: it replaces the glossary’s entire IAM policy with the specified bindings. Any permissions not included in policyData are removed.
Grant a role to multiple members at once
When multiple users or service accounts need the same access level, you can bind them all to a single role without affecting other role assignments.
import * as pulumi from "@pulumi/pulumi";
import * as gcp from "@pulumi/gcp";
const binding = new gcp.dataplex.GlossaryIamBinding("binding", {
project: glossaryTestId.project,
location: glossaryTestId.location,
glossaryId: glossaryTestId.glossaryId,
role: "roles/viewer",
members: ["user:jane@example.com"],
});
import pulumi
import pulumi_gcp as gcp
binding = gcp.dataplex.GlossaryIamBinding("binding",
project=glossary_test_id["project"],
location=glossary_test_id["location"],
glossary_id=glossary_test_id["glossaryId"],
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.NewGlossaryIamBinding(ctx, "binding", &dataplex.GlossaryIamBindingArgs{
Project: pulumi.Any(glossaryTestId.Project),
Location: pulumi.Any(glossaryTestId.Location),
GlossaryId: pulumi.Any(glossaryTestId.GlossaryId),
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.GlossaryIamBinding("binding", new()
{
Project = glossaryTestId.Project,
Location = glossaryTestId.Location,
GlossaryId = glossaryTestId.GlossaryId,
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.GlossaryIamBinding;
import com.pulumi.gcp.dataplex.GlossaryIamBindingArgs;
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 GlossaryIamBinding("binding", GlossaryIamBindingArgs.builder()
.project(glossaryTestId.project())
.location(glossaryTestId.location())
.glossaryId(glossaryTestId.glossaryId())
.role("roles/viewer")
.members("user:jane@example.com")
.build());
}
}
resources:
binding:
type: gcp:dataplex:GlossaryIamBinding
properties:
project: ${glossaryTestId.project}
location: ${glossaryTestId.location}
glossaryId: ${glossaryTestId.glossaryId}
role: roles/viewer
members:
- user:jane@example.com
The members property lists all identities that should have the specified role. GlossaryIamBinding is authoritative for its role: it replaces all members for that role but preserves other roles on the glossary. This approach works well when you manage all viewers, editors, or admins as a group.
Add a single member to a role incrementally
When you need to grant access to one user without disturbing existing permissions, you can add individual members non-authoritatively.
import * as pulumi from "@pulumi/pulumi";
import * as gcp from "@pulumi/gcp";
const member = new gcp.dataplex.GlossaryIamMember("member", {
project: glossaryTestId.project,
location: glossaryTestId.location,
glossaryId: glossaryTestId.glossaryId,
role: "roles/viewer",
member: "user:jane@example.com",
});
import pulumi
import pulumi_gcp as gcp
member = gcp.dataplex.GlossaryIamMember("member",
project=glossary_test_id["project"],
location=glossary_test_id["location"],
glossary_id=glossary_test_id["glossaryId"],
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.NewGlossaryIamMember(ctx, "member", &dataplex.GlossaryIamMemberArgs{
Project: pulumi.Any(glossaryTestId.Project),
Location: pulumi.Any(glossaryTestId.Location),
GlossaryId: pulumi.Any(glossaryTestId.GlossaryId),
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.GlossaryIamMember("member", new()
{
Project = glossaryTestId.Project,
Location = glossaryTestId.Location,
GlossaryId = glossaryTestId.GlossaryId,
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.GlossaryIamMember;
import com.pulumi.gcp.dataplex.GlossaryIamMemberArgs;
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 GlossaryIamMember("member", GlossaryIamMemberArgs.builder()
.project(glossaryTestId.project())
.location(glossaryTestId.location())
.glossaryId(glossaryTestId.glossaryId())
.role("roles/viewer")
.member("user:jane@example.com")
.build());
}
}
resources:
member:
type: gcp:dataplex:GlossaryIamMember
properties:
project: ${glossaryTestId.project}
location: ${glossaryTestId.location}
glossaryId: ${glossaryTestId.glossaryId}
role: roles/viewer
member: user:jane@example.com
The member property specifies a single identity to grant the role. GlossaryIamMember is non-authoritative: it adds this member to the role without removing other members. This is the safest approach for incremental access grants, as it won’t accidentally revoke existing permissions.
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 control. They’re intentionally minimal rather than full access control systems.
The examples reference pre-existing infrastructure such as Dataplex glossary resources (glossaryId), and GCP project and location. They focus on configuring IAM policies rather than provisioning the glossaries themselves.
To keep things focused, common IAM patterns are omitted, including:
- Conditional IAM bindings (condition blocks)
- Custom role definitions
- Service account impersonation
- IAM policy auditing and drift detection
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 Glossary IAM Policy resource reference for all available configuration options.
Let's manage GCP Dataplex Glossary IAM Policies
Get started with Pulumi Cloud, then follow our quick setup guide to deploy this infrastructure.
Try Pulumi Cloud for FREEFrequently Asked Questions
Resource Conflicts & Compatibility
GlossaryIamPolicy cannot be used together with GlossaryIamBinding or GlossaryIamMember because they will conflict over policy control.Resource Selection & Usage
Choose based on your needs:
- GlossaryIamPolicy - Authoritative control of the entire policy (replaces existing policy)
- GlossaryIamBinding - Authoritative control of all members for a specific role (preserves other roles)
- GlossaryIamMember - Non-authoritative addition of individual members (preserves other members)
GlossaryIamPolicy and GlossaryIamBinding) replace existing permissions, while non-authoritative resources (GlossaryIamMember) add permissions without removing others.GlossaryIamMember uses member (singular string) for a single identity, while GlossaryIamBinding uses members (array) for multiple identities.Configuration & Requirements
glossaryId, location, policyData, and project. All except policyData are immutable after creation.gcp.organizations.getIAMPolicy data source to generate policy data, then pass it to the policyData property.Import & Migration
Four formats are supported (from most to least specific):
projects/{{project}}/locations/{{location}}/glossaries/{{glossary_id}}{{project}}/{{location}}/{{glossary_id}}{{location}}/{{glossary_id}}{{glossary_id}}
Missing values are taken from the provider configuration.