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
resource "google_bigtable_table" "scale_traffic" {
# Arguments
project = var.project
name = "scale-traffic"
instance_name = google_bigtable_instance.scale_bigtable.name
resource "google_bigtable_table" "subscriptions" {
name = "subscriptions"
instance_name = google_bigtable_instance.instance.name
resource "google_bigtable_table" "this" {
instance_name = var.instance_name
name = var.name
project = var.project
split_keys = var.split_keys
resource "google_bigtable_table" "tb1" {
name = "tb-from-tf"
instance_name = google_bigtable_instance.bt-from-tf.name
resource "google_bigtable_table" "session" {
name = "session"
instance_name = google_bigtable_instance.instance.name
column_family {
family = "main"
}
Parameters
-
id
optional computed - string -
instance_name
required - string
The name of the Bigtable instance.
-
name
required - string
The name of the table.
-
project
optional computed - 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 of 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.
-
column_family
set block-
family
required - string
The name of the column family.
-
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.