google_bigtable_instance

Creates a Google Bigtable instance. For more information see:

Example Usage - Simple Instance

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

  cluster {
    cluster_id   = "tf-instance-cluster"
    num_nodes    = 1
    storage_type = "HDD"
  }

  labels = {
    my-label = "prod-label"
  }
}

Example Usage - Replicated Instance

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

  # A cluster with fixed number of nodes.
  cluster {
    cluster_id   = "tf-instance-cluster1"
    num_nodes    = 1
    storage_type = "HDD"
    zone    = "us-central1-c"
  }

  # a cluster with auto scaling.
  cluster {
    cluster_id   = "tf-instance-cluster2"
    storage_type = "HDD"
    zone    = "us-central1-b"
    autoscaling_config {
      min_nodes = 1
      max_nodes = 3
      cpu_target = 50
    }
  }

  labels = {
    my-label = "prod-label"
  }
}

Argument Reference

The following arguments are supported:



The cluster block 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:

Adding clusters to existing instances can take a long time. Consider setting a higher value to timeouts if you plan on doing that.

Import

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

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

import {
  id = "projects/{{project}}/instances/{{name}}"
  to = google_bigtable_instance.default
}

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

$ terraform import google_bigtable_instance.default projects/{{project}}/instances/{{name}}
$ terraform import google_bigtable_instance.default {{project}}/{{name}}
$ terraform import google_bigtable_instance.default {{name}}