The gcp:datacatalog/taxonomyIamBinding:TaxonomyIamBinding resource, part of the Pulumi GCP provider, manages IAM role bindings for Data Catalog taxonomies. It authoritatively grants a specific role to a list of members, replacing any previous member list for that role. This guide focuses on two capabilities: granting roles to multiple members and adding individual members to roles.
IAM bindings reference existing taxonomies and require valid member identifiers. The examples are intentionally small. Combine them with your own taxonomy resources and organizational access patterns.
Grant a role to multiple members
Teams managing taxonomies 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.datacatalog.TaxonomyIamBinding("binding", {
taxonomy: basicTaxonomy.name,
role: "roles/viewer",
members: ["user:jane@example.com"],
});
import pulumi
import pulumi_gcp as gcp
binding = gcp.datacatalog.TaxonomyIamBinding("binding",
taxonomy=basic_taxonomy["name"],
role="roles/viewer",
members=["user:jane@example.com"])
package main
import (
"github.com/pulumi/pulumi-gcp/sdk/v9/go/gcp/datacatalog"
"github.com/pulumi/pulumi/sdk/v3/go/pulumi"
)
func main() {
pulumi.Run(func(ctx *pulumi.Context) error {
_, err := datacatalog.NewTaxonomyIamBinding(ctx, "binding", &datacatalog.TaxonomyIamBindingArgs{
Taxonomy: pulumi.Any(basicTaxonomy.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.DataCatalog.TaxonomyIamBinding("binding", new()
{
Taxonomy = basicTaxonomy.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.datacatalog.TaxonomyIamBinding;
import com.pulumi.gcp.datacatalog.TaxonomyIamBindingArgs;
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 TaxonomyIamBinding("binding", TaxonomyIamBindingArgs.builder()
.taxonomy(basicTaxonomy.name())
.role("roles/viewer")
.members("user:jane@example.com")
.build());
}
}
resources:
binding:
type: gcp:datacatalog:TaxonomyIamBinding
properties:
taxonomy: ${basicTaxonomy.name}
role: roles/viewer
members:
- user:jane@example.com
The members property lists all identities that receive the specified role. TaxonomyIamBinding is authoritative for the role, meaning it replaces any existing member list. The taxonomy property references the taxonomy resource by name, and role specifies the IAM role to grant (predefined roles like “roles/viewer” or custom roles in the format “projects/{project}/roles/{role-name}”).
Add a single member to a role
When onboarding individual users, TaxonomyIamMember adds one member without affecting others.
import * as pulumi from "@pulumi/pulumi";
import * as gcp from "@pulumi/gcp";
const member = new gcp.datacatalog.TaxonomyIamMember("member", {
taxonomy: basicTaxonomy.name,
role: "roles/viewer",
member: "user:jane@example.com",
});
import pulumi
import pulumi_gcp as gcp
member = gcp.datacatalog.TaxonomyIamMember("member",
taxonomy=basic_taxonomy["name"],
role="roles/viewer",
member="user:jane@example.com")
package main
import (
"github.com/pulumi/pulumi-gcp/sdk/v9/go/gcp/datacatalog"
"github.com/pulumi/pulumi/sdk/v3/go/pulumi"
)
func main() {
pulumi.Run(func(ctx *pulumi.Context) error {
_, err := datacatalog.NewTaxonomyIamMember(ctx, "member", &datacatalog.TaxonomyIamMemberArgs{
Taxonomy: pulumi.Any(basicTaxonomy.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.DataCatalog.TaxonomyIamMember("member", new()
{
Taxonomy = basicTaxonomy.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.datacatalog.TaxonomyIamMember;
import com.pulumi.gcp.datacatalog.TaxonomyIamMemberArgs;
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 TaxonomyIamMember("member", TaxonomyIamMemberArgs.builder()
.taxonomy(basicTaxonomy.name())
.role("roles/viewer")
.member("user:jane@example.com")
.build());
}
}
resources:
member:
type: gcp:datacatalog:TaxonomyIamMember
properties:
taxonomy: ${basicTaxonomy.name}
role: roles/viewer
member: user:jane@example.com
The member property specifies a single identity to add to the role. Unlike TaxonomyIamBinding, TaxonomyIamMember is non-authoritative: it adds the member to the role without removing existing members. This allows multiple TaxonomyIamMember resources to grant the same role to different members, as long as you don’t also use TaxonomyIamBinding for that role.
Beyond these examples
These snippets focus on specific IAM binding features: role-based access control and member management. They’re intentionally minimal rather than full access control configurations.
The examples reference pre-existing infrastructure such as Data Catalog taxonomies. They focus on configuring IAM bindings rather than provisioning taxonomies or defining custom roles.
To keep things focused, common IAM patterns are omitted, including:
- Conditional IAM bindings (condition property)
- Policy-level management (TaxonomyIamPolicy)
- Custom role definitions
- Cross-project or organization-level access
These omissions are intentional: the goal is to illustrate how IAM bindings are wired, not provide drop-in access control modules. See the TaxonomyIamBinding resource reference for all available configuration options.
Let's manage GCP Data Catalog Taxonomy 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
TaxonomyIamPolicy is authoritative and replaces the entire IAM policy. TaxonomyIamBinding is authoritative for a specific role but preserves other roles. TaxonomyIamMember is non-authoritative and preserves other members for the same role.TaxonomyIamPolicy cannot be used with TaxonomyIamBinding or TaxonomyIamMember as they will conflict over the policy configuration.IAM Configuration
members field supports: 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}. For example, projects/my-project/roles/my-custom-role.project and region default to the provider configuration if not specified. They can also be parsed from the parent taxonomy identifier.Import & Advanced Usage
pulumi import gcp:datacatalog/taxonomyIamBinding:TaxonomyIamBinding editor "projects/{{project}}/locations/{{region}}/taxonomies/{{taxonomy}} roles/viewer". For custom roles, use the full role name.