The gcp:datacatalog/tagTemplateIamMember:TagTemplateIamMember resource, part of the Pulumi GCP provider, grants IAM permissions on Data Catalog tag templates using non-authoritative member grants. Note that the parent TagTemplate resource is deprecated; for new projects, consider using gcp.dataplex.AspectType instead. This guide focuses on three IAM management approaches: single-member grants, multi-member role bindings, and complete policy replacement.
IAM resources for tag templates come in three variants (Policy, Binding, Member) that reference existing tag templates. Policy resources cannot be used with Binding or Member resources, as they conflict over permission management. The examples are intentionally small. Combine them with your own tag template infrastructure and identity management.
Grant a single user access to a tag template
When you need to add one user or service account without affecting other permissions, non-authoritative member grants preserve existing access.
import * as pulumi from "@pulumi/pulumi";
import * as gcp from "@pulumi/gcp";
const member = new gcp.datacatalog.TagTemplateIamMember("member", {
tagTemplate: basicTagTemplate.name,
role: "roles/viewer",
member: "user:jane@example.com",
});
import pulumi
import pulumi_gcp as gcp
member = gcp.datacatalog.TagTemplateIamMember("member",
tag_template=basic_tag_template["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.NewTagTemplateIamMember(ctx, "member", &datacatalog.TagTemplateIamMemberArgs{
TagTemplate: pulumi.Any(basicTagTemplate.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.TagTemplateIamMember("member", new()
{
TagTemplate = basicTagTemplate.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.TagTemplateIamMember;
import com.pulumi.gcp.datacatalog.TagTemplateIamMemberArgs;
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 TagTemplateIamMember("member", TagTemplateIamMemberArgs.builder()
.tagTemplate(basicTagTemplate.name())
.role("roles/viewer")
.member("user:jane@example.com")
.build());
}
}
resources:
member:
type: gcp:datacatalog:TagTemplateIamMember
properties:
tagTemplate: ${basicTagTemplate.name}
role: roles/viewer
member: user:jane@example.com
The member property specifies the identity to grant access, using formats like “user:email@example.com” or “serviceAccount:name@project.iam.gserviceaccount.com”. The role property defines the permission level. This resource adds the member without removing other members from the same role or affecting other roles on the template.
Grant multiple users the same role
When multiple users need identical permissions, binding resources grant a role to a list at once.
import * as pulumi from "@pulumi/pulumi";
import * as gcp from "@pulumi/gcp";
const binding = new gcp.datacatalog.TagTemplateIamBinding("binding", {
tagTemplate: basicTagTemplate.name,
role: "roles/viewer",
members: ["user:jane@example.com"],
});
import pulumi
import pulumi_gcp as gcp
binding = gcp.datacatalog.TagTemplateIamBinding("binding",
tag_template=basic_tag_template["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.NewTagTemplateIamBinding(ctx, "binding", &datacatalog.TagTemplateIamBindingArgs{
TagTemplate: pulumi.Any(basicTagTemplate.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.TagTemplateIamBinding("binding", new()
{
TagTemplate = basicTagTemplate.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.TagTemplateIamBinding;
import com.pulumi.gcp.datacatalog.TagTemplateIamBindingArgs;
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 TagTemplateIamBinding("binding", TagTemplateIamBindingArgs.builder()
.tagTemplate(basicTagTemplate.name())
.role("roles/viewer")
.members("user:jane@example.com")
.build());
}
}
resources:
binding:
type: gcp:datacatalog:TagTemplateIamBinding
properties:
tagTemplate: ${basicTagTemplate.name}
role: roles/viewer
members:
- user:jane@example.com
The members property accepts an array of identities that all receive the specified role. This resource is authoritative for the given role: it replaces any existing members for that role but preserves other roles on the template. Use this when you manage all members for a specific role together.
Replace all permissions with a complete policy
Organizations with centralized IAM management define complete policies that replace all 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.datacatalog.TagTemplateIamPolicy("policy", {
tagTemplate: basicTagTemplate.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.datacatalog.TagTemplateIamPolicy("policy",
tag_template=basic_tag_template["name"],
policy_data=admin.policy_data)
package main
import (
"github.com/pulumi/pulumi-gcp/sdk/v9/go/gcp/datacatalog"
"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 = datacatalog.NewTagTemplateIamPolicy(ctx, "policy", &datacatalog.TagTemplateIamPolicyArgs{
TagTemplate: pulumi.Any(basicTagTemplate.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.DataCatalog.TagTemplateIamPolicy("policy", new()
{
TagTemplate = basicTagTemplate.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.datacatalog.TagTemplateIamPolicy;
import com.pulumi.gcp.datacatalog.TagTemplateIamPolicyArgs;
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 TagTemplateIamPolicy("policy", TagTemplateIamPolicyArgs.builder()
.tagTemplate(basicTagTemplate.name())
.policyData(admin.policyData())
.build());
}
}
resources:
policy:
type: gcp:datacatalog:TagTemplateIamPolicy
properties:
tagTemplate: ${basicTagTemplate.name}
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 a complete IAM policy, typically constructed using the getIAMPolicy data source. This resource is fully authoritative: it replaces all roles and members on the tag template. Use this when you need complete control over permissions and want to prevent manual changes.
Beyond these examples
These snippets focus on specific IAM management features: non-authoritative member grants, role-level binding management, and complete policy replacement. They’re intentionally minimal rather than full access control configurations.
The examples reference pre-existing infrastructure such as tag templates (referenced by name). They focus on IAM configuration rather than provisioning the templates themselves.
To keep things focused, common IAM patterns are omitted, including:
- Conditional IAM grants (condition property)
- Custom role definitions
- Cross-project or cross-region references
- Federated identity principals
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 TagTemplateIamMember resource reference for all available configuration options.
Let's manage GCP Data Catalog Tag Template IAM Access
Get started with Pulumi Cloud, then follow our quick setup guide to deploy this infrastructure.
Try Pulumi Cloud for FREEFrequently Asked Questions
Deprecation & Migration
gcp.datacatalog.TagTemplate is deprecated and will be removed in a future major release. Migrate to gcp.dataplex.AspectType instead. See the transition guide at https://cloud.google.com/dataplex/docs/transition-to-dataplex-catalog.IAM Resource Selection & Conflicts
Each serves a different use case:
TagTemplateIamPolicy: Authoritative. Replaces the entire IAM policy.TagTemplateIamBinding: Authoritative for a given role. Grants a role to a list of members while preserving other roles.TagTemplateIamMember: Non-authoritative. Adds a single member to a role while preserving other members.
TagTemplateIamPolicy cannot be used with TagTemplateIamBinding or TagTemplateIamMember because they will conflict over policy management.Identity & Role Configuration
[projects|organizations]/{parent-name}/roles/{role-name}.The member property supports:
allUsers: Anyone on the internetallAuthenticatedUsers: Anyone with a Google accountuser:{email}: Specific Google accountserviceAccount:{email}: Service accountgroup:{email}: Google groupdomain:{domain}: G Suite domainprojectOwner/Editor/Viewer:{projectid}: Project-level roles- Federated identities (see Principal identifiers documentation)