IAM policy for Bigtable table

Three different resources help you manage IAM policies on bigtable tables. Each of these resources serves a different use case:

google_bigtable_table_iam_policy

data "google_iam_policy" "admin" {
  binding {
    role = "roles/bigtable.user"
    members = [
      "user:jane@example.com",
    ]
  }
}

resource "google_bigtable_table_iam_policy" "editor" {
  project     = "your-project"
  instance    = "your-bigtable-instance"
  table       = "your-bigtable-table"
  policy_data = data.google_iam_policy.admin.policy_data
}

google_bigtable_table_iam_binding

resource "google_bigtable_table_iam_binding" "editor" {
  table       = "your-bigtable-table"
  instance    = "your-bigtable-instance"
  role     = "roles/bigtable.user"
  members = [
    "user:jane@example.com",
  ]
}

google_bigtable_table_iam_member

resource "google_bigtable_table_iam_member" "editor" {
  table       = "your-bigtable-table"
  instance    = "your-bigtable-instance"
  role        = "roles/bigtable.user"
  member      = "user:jane@example.com"
}

Argument Reference

The following arguments are supported:

For google_bigtable_table_iam_member or google_bigtable_table_iam_binding:

google_bigtable_table_iam_policy only:


Attributes Reference

In addition to the arguments listed above, the following computed attributes are exported:

Import

Importing IAM members

IAM member imports use space-delimited identifiers that contain the resource's table, role, and member. For example:

An import block (Terraform v1.5.0 and later) can be used to import IAM members:

import {
  id = "projects/{project}/instances/{instance}/tables/{table} roles/editor user:jane@example.com"
  to = google_bigtable_table_iam_member.default
}

The terraform import command can also be used:

$ terraform import google_bigtable_table_iam_member.default "projects/{project}/instances/{instance}/tables/{table} roles/editor user:jane@example.com"

Importing IAM bindings

IAM binding imports use space-delimited identifiers that contain the resource's table and role. For example:

An import block (Terraform v1.5.0 and later) can be used to import IAM bindings:

import {
  id = "projects/{project}/instances/{instance}/tables/{table} roles/editor"
  to = google_bigtable_table_iam_binding.default
}

The terraform import command can also be used:

$ terraform import google_bigtable_table_iam_binding.default "projects/{project}/instances/{instance}/tables/{table} roles/editor"

Importing IAM policies

IAM policy imports use the table identifier of the Bigtable Table resource only. For example:

An import block (Terraform v1.5.0 and later) can be used to import IAM policies:

import {
  id = "projects/{project}/instances/{instance}/tables/{table}"
  to = google_bigtable_table_iam_policy.default
}

The terraform import command can also be used:

$ terraform import google_bigtable_table_iam_policy.default projects/{project}/instances/{instance}/tables/{table}