» google_bigtable_instance

Creates a Google Bigtable instance. For more information see the official documentation and API.

» Example Usage - Production Instance

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

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

  lifecycle {
    prevent_destroy = true
  }

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

» Example Usage - Development Instance

resource "google_bigtable_instance" "development-instance" {
  name          = "tf-instance"
  instance_type = "DEVELOPMENT"

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

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

» Argument Reference

The following arguments are supported:

  • name - (Required) The name (also called Instance Id in the Cloud Console) of the Cloud Bigtable instance.

  • cluster - (Required) A block of cluster configuration options. This can be specified at least once, and up to 4 times. See structure below.


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

  • instance_type - (Optional, Deprecated) The instance type to create. One of "DEVELOPMENT" or "PRODUCTION". Defaults to "PRODUCTION". It is recommended to leave this field unspecified since the distinction between "DEVELOPMENT" and "PRODUCTION" instances is going away, and all instances will become "PRODUCTION" instances. This means that new and existing "DEVELOPMENT" instances will be converted to "PRODUCTION" instances. It is recommended for users to use "PRODUCTION" instances in any case, since a 1-node "PRODUCTION" instance is functionally identical to a "DEVELOPMENT" instance, but without the accompanying restrictions.

  • display_name - (Optional) The human-readable display name of the Bigtable instance. Defaults to the instance name.

  • deletion_protection - (Optional) Whether or not to allow Terraform to destroy the instance. Unless this field is set to false in Terraform state, a terraform destroy or terraform apply that would delete the instance will fail.

  • labels - (Optional) A set of key/value label pairs to assign to the resource. Label keys must follow the requirements at https://cloud.google.com/resource-manager/docs/creating-managing-labels#requirements.


The cluster block supports the following arguments:

  • cluster_id - (Required) The ID of the Cloud Bigtable cluster.

  • zone - (Required) The zone to create the Cloud Bigtable cluster in. Each cluster must have a different zone in the same region. Zones that support Bigtable instances are noted on the Cloud Bigtable locations page.

  • num_nodes - (Optional) The number of nodes in your Cloud Bigtable cluster. Required, with a minimum of 1 for a PRODUCTION instance. Must be left unset for a DEVELOPMENT instance.

  • storage_type - (Optional) The storage type to use. One of "SSD" or "HDD". Defaults to "SSD".

» Attributes Reference

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

  • id - an identifier for the resource with format projects/{{project}}/instances/{{name}}

» Import

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

$ 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}}