The gcp:bigtable/tableIamBinding:TableIamBinding resource, part of the Pulumi GCP provider, manages IAM role bindings for Bigtable tables by granting a specific role to a list of members. This guide focuses on two capabilities: granting roles to multiple members and adding individual members to roles.
This resource is one of three IAM management options for Bigtable tables. TableIamBinding is authoritative for a given role, meaning it replaces all members for that role while preserving other roles. TableIamMember adds individual members non-authoritatively, and TableIamPolicy replaces the entire policy. The examples reference existing Bigtable tables and instances. Combine them with your own table and instance resources.
Grant a role to multiple members
When managing access for teams, you 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 editor = new gcp.bigtable.TableIamBinding("editor", {
table: "your-bigtable-table",
instanceName: "your-bigtable-instance",
role: "roles/bigtable.user",
members: ["user:jane@example.com"],
});
import pulumi
import pulumi_gcp as gcp
editor = gcp.bigtable.TableIamBinding("editor",
table="your-bigtable-table",
instance_name="your-bigtable-instance",
role="roles/bigtable.user",
members=["user:jane@example.com"])
package main
import (
"github.com/pulumi/pulumi-gcp/sdk/v9/go/gcp/bigtable"
"github.com/pulumi/pulumi/sdk/v3/go/pulumi"
)
func main() {
pulumi.Run(func(ctx *pulumi.Context) error {
_, err := bigtable.NewTableIamBinding(ctx, "editor", &bigtable.TableIamBindingArgs{
Table: pulumi.String("your-bigtable-table"),
InstanceName: pulumi.String("your-bigtable-instance"),
Role: pulumi.String("roles/bigtable.user"),
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 editor = new Gcp.BigTable.TableIamBinding("editor", new()
{
Table = "your-bigtable-table",
InstanceName = "your-bigtable-instance",
Role = "roles/bigtable.user",
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.bigtable.TableIamBinding;
import com.pulumi.gcp.bigtable.TableIamBindingArgs;
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 editor = new TableIamBinding("editor", TableIamBindingArgs.builder()
.table("your-bigtable-table")
.instanceName("your-bigtable-instance")
.role("roles/bigtable.user")
.members("user:jane@example.com")
.build());
}
}
resources:
editor:
type: gcp:bigtable:TableIamBinding
properties:
table: your-bigtable-table
instanceName: your-bigtable-instance
role: roles/bigtable.user
members:
- user:jane@example.com
The members property accepts a list of identity strings in specific formats: user:{email} for individual accounts, serviceAccount:{email} for service accounts, group:{email} for Google Groups, or domain:{domain} for all users in a G Suite domain. The role property specifies which Bigtable role to grant; this resource is authoritative for that role, replacing any existing members.
Add a single member to a role
For individual onboarding, you can add one member to a role without affecting others who already have it.
import * as pulumi from "@pulumi/pulumi";
import * as gcp from "@pulumi/gcp";
const editor = new gcp.bigtable.TableIamMember("editor", {
table: "your-bigtable-table",
instanceName: "your-bigtable-instance",
role: "roles/bigtable.user",
member: "user:jane@example.com",
});
import pulumi
import pulumi_gcp as gcp
editor = gcp.bigtable.TableIamMember("editor",
table="your-bigtable-table",
instance_name="your-bigtable-instance",
role="roles/bigtable.user",
member="user:jane@example.com")
package main
import (
"github.com/pulumi/pulumi-gcp/sdk/v9/go/gcp/bigtable"
"github.com/pulumi/pulumi/sdk/v3/go/pulumi"
)
func main() {
pulumi.Run(func(ctx *pulumi.Context) error {
_, err := bigtable.NewTableIamMember(ctx, "editor", &bigtable.TableIamMemberArgs{
Table: pulumi.String("your-bigtable-table"),
InstanceName: pulumi.String("your-bigtable-instance"),
Role: pulumi.String("roles/bigtable.user"),
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 editor = new Gcp.BigTable.TableIamMember("editor", new()
{
Table = "your-bigtable-table",
InstanceName = "your-bigtable-instance",
Role = "roles/bigtable.user",
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.bigtable.TableIamMember;
import com.pulumi.gcp.bigtable.TableIamMemberArgs;
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 editor = new TableIamMember("editor", TableIamMemberArgs.builder()
.table("your-bigtable-table")
.instanceName("your-bigtable-instance")
.role("roles/bigtable.user")
.member("user:jane@example.com")
.build());
}
}
resources:
editor:
type: gcp:bigtable:TableIamMember
properties:
table: your-bigtable-table
instanceName: your-bigtable-instance
role: roles/bigtable.user
member: user:jane@example.com
The member property (singular) accepts one identity string. Unlike TableIamBinding, TableIamMember is non-authoritative: it adds the member without removing others. Use this when you need incremental access grants rather than managing the full member list for a role.
Beyond these examples
These snippets focus on specific table IAM features: role-based access control and member and binding management. They’re intentionally minimal rather than full access control configurations.
The examples reference pre-existing infrastructure such as Bigtable tables and instances, and a Google Cloud project with Bigtable API enabled. They focus on IAM binding configuration rather than provisioning the underlying resources.
To keep things focused, common IAM patterns are omitted, including:
- Conditional IAM bindings (condition property)
- Full policy replacement (TableIamPolicy resource)
- Project-level configuration (project property)
- Custom role definitions
These omissions are intentional: the goal is to illustrate how each IAM binding feature is wired, not provide drop-in access control modules. See the Bigtable TableIamBinding resource reference for all available configuration options.
Let's manage GCP Bigtable Table 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 & Compatibility
TableIamPolicy is fully authoritative and replaces the entire IAM policy. TableIamBinding is authoritative for a specific role but preserves other roles. TableIamMember is non-authoritative and adds individual members without affecting others.TableIamPolicy with TableIamBinding or TableIamMember as they’ll conflict. You can use TableIamBinding with TableIamMember only if they manage different roles.TableIamPolicy alongside TableIamBinding or TableIamMember causes conflicts because they compete to control the same policy. Similarly, using TableIamBinding and TableIamMember for the same role will conflict.TableIamPolicy, ensure you include ownership roles in your policy since it replaces the entire IAM policy rather than adding to it.Configuration & Roles
[projects|organizations]/{parent-name}/roles/{role-name}, for example projects/my-project/roles/customRole.TableIamBinding with the members array property. For adding individual members without affecting others, use TableIamMember instead.Immutability & Limitations
instanceName, project, role, table, and condition properties are all immutable and require resource replacement if changed.