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

github-iconcodecentric/gcloud-scale-dev-friday
resource "google_bigtable_table" "scale_traffic" {
  # Arguments
  project       = var.project
  name          = "scale-traffic"
  instance_name = google_bigtable_instance.scale_bigtable.name

github-iconpilipenok/tango_test
resource "google_bigtable_table" "subscriptions" {
  name          = "subscriptions"
  instance_name = google_bigtable_instance.instance.name
github-iconniveklabs/google
resource "google_bigtable_table" "this" {
  instance_name = var.instance_name
  name          = var.name
  project       = var.project
  split_keys    = var.split_keys

github-iconankit25587/course-material
resource "google_bigtable_table" "tb1" {
  name = "tb-from-tf"
  instance_name = google_bigtable_instance.bt-from-tf.name
github-iconGoogleCloudPlatform/bq-mirroring-cdc
resource "google_bigtable_table" "session" {
  name = "session"
  instance_name = google_bigtable_instance.instance.name
  column_family {
    family = "main"
  }

Parameters

  • id optionalcomputed - string
  • instance_name required - string
    • The name of the Bigtable instance.

  • name required - string
    • The name of the table.

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

  • split_keys optional - list / string
    • 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

Scan your IaC problem in 3 minutes for free

You can keep your IaC security for free. No credit card required.