Google Cloud Bigtable Table

This page shows how to write Terraform for Cloud Bigtable Table and write them securely.

google_bigtable_table (Terraform)

The Table in Cloud Bigtable can be configured in Terraform with the resource name google_bigtable_table. The following sections describe 5 examples of how to use the resource and its parameters.

Example Usage from GitHub

main.tf#L26
resource "google_bigtable_table" "scale_traffic" {
  # Arguments
  project       = var.project
  name          = "scale-traffic"
  instance_name = google_bigtable_instance.scale_bigtable.name

bigtable.tf#L17
resource "google_bigtable_table" "subscriptions" {
  name          = "subscriptions"
  instance_name = google_bigtable_instance.instance.name
main.tf#L7
resource "google_bigtable_table" "this" {
  instance_name = var.instance_name
  name          = var.name
  project       = var.project
  split_keys    = var.split_keys

main.tf#L17
resource "google_bigtable_table" "tb1" {
  name = "tb-from-tf"
  instance_name = google_bigtable_instance.bt-from-tf.name
bigtable.tf#L28
resource "google_bigtable_table" "session" {
  name = "session"
  instance_name = google_bigtable_instance.instance.name
  column_family {
    family = "main"
  }

Review your Terraform file for Google best practices

Shisho Cloud, our free checker to make sure your Terraform configuration follows best practices, is available (beta).

Parameters

The name of the Bigtable instance.

The name of the table.

The ID of the project in which the resource belongs. If it is not provided, the provider project is used.

A list of predefined keys to split the table on. !> Warning: Modifying the split_keys of an existing table will cause Terraform to delete/recreate the entire google_bigtable_table resource.

Explanation in Terraform Registry

Creates a Google Cloud Bigtable table inside an instance. For more information see the official documentation and API. -> Note: It is strongly recommended to set lifecycle { prevent_destroy = true } on tables in order to prevent accidental data loss. See Terraform docs for more information on lifecycle parameters.

Frequently asked questions

What is Google Cloud Bigtable Table?

Google Cloud Bigtable Table is a resource for Cloud Bigtable of Google Cloud Platform. Settings can be wrote in Terraform.

Where can I find the example code for the Google Cloud Bigtable Table?

For Terraform, the codecentric/gcloud-scale-dev-friday, pilipenok/tango_test and niveklabs/google source code examples are useful. See the Terraform Example section for further details.

security-icon

Automate config file reviews on your commits

Fix issues in your infrastructure as code with auto-generated patches.