google_bigtable_table

Creates a Google Cloud Bigtable table inside an instance. For more information see the official documentation and API.

Example Usage

resource "google_bigtable_instance" "instance" {
  name = "tf-instance"

  cluster {
    cluster_id   = "tf-instance-cluster"
    zone         = "us-central1-b"
    num_nodes    = 3
    storage_type = "HDD"
  }

  lifecycle {
    prevent_destroy = true
  }
}

resource "google_bigtable_table" "table" {
  name          = "tf-table"
  instance_name = google_bigtable_instance.instance.name
  split_keys    = ["a", "b", "c"]

  lifecycle {
    prevent_destroy = true
  }

  column_family {
    family = "family-first"
  }

  column_family {
    family = "family-second"
  }

  change_stream_retention = "24h0m0s"
}

Argument Reference

The following arguments are supported:


column_family supports the following arguments:

Attributes Reference

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

Timeouts

This resource provides the following Timeouts configuration options:

Import

Bigtable Tables can be imported using any of these accepted formats:

In Terraform v1.5.0 and later, use an import block to import Bigtable Tables using one of the formats above. For example:

import {
  id = "projects/{{project}}/instances/{{instance_name}}/tables/{{name}}"
  to = google_bigtable_table.default
}

When using the terraform import command, Bigtable Tables can be imported using one of the formats above. For example:

$ terraform import google_bigtable_table.default projects/{{project}}/instances/{{instance_name}}/tables/{{name}}
$ terraform import google_bigtable_table.default {{project}}/{{instance_name}}/{{name}}
$ terraform import google_bigtable_table.default {{instance_name}}/{{name}}