Google Cloud Bigtable Instance

This page shows how to write Terraform for Cloud Bigtable Instance and write them securely.

google_bigtable_instance (Terraform)

The Instance in Cloud Bigtable can be configured in Terraform with the resource name google_bigtable_instance. 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_instance" "scale_bigtable" {
  # Arguments
  project = var.project  # TODO: Move project central to provider
  name = "scale-bigtable"
  deletion_protection = false

github-iconalisahp/gcp
resource "google_bigtable_instance" "production-instance" {
  name                = var.config["name"]
  deletion_protection = var.config["deletion_protection"]
  cluster {
    cluster_id   = var.config["cluster_id"]
    num_nodes    = var.config["num_nodes"]
github-iconmarcelopicarelli/google-datalake
resource "google_bigtable_instance" "development-instance" {
  name          = var.name
  instance_type = var.instance_type

  cluster {
    cluster_id   = var.cluster_id
github-iconfarrukh90/gcp
resource "google_bigtable_instance" "production-instance" {
  name                = var.config["name"]
  deletion_protection = var.config["deletion_protection"]
  cluster {
    cluster_id   = var.config["cluster_id"]
    num_nodes    = var.config["num_nodes"]
github-iconpilipenok/tango_test
resource "google_bigtable_instance" "instance" {
  name = "tango-instance"

  cluster {
    cluster_id   = "tango-instance-cluster"
    num_nodes    = 1

Parameters

  • deletion_protection optional - bool
    • 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.

  • display_name optionalcomputed - string
    • The human-readable display name of the Bigtable instance. Defaults to the instance name.

  • id optionalcomputed - string
  • instance_type optional - string
    • The instance type to create. One of "DEVELOPMENT" or "PRODUCTION". Defaults to "PRODUCTION".

  • labels optional - map / string
    • A mapping of labels to assign to the resource.

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

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

Explanation in Terraform Registry

Creates a Google Bigtable instance. For more information see:

  • API documentation
  • How-to Guides
    • Official Documentation ->Note: It is strongly recommended to set lifecycle { prevent_destroy = true } on instances in order to prevent accidental data loss. See Terraform docs for more information on lifecycle parameters. ->Note: On newer versions of the provider, you must explicitly set deletion_protection=false (and run terraform apply to write the field to state) in order to destroy an instance. It is recommended to not set this field (or set it to true) until you're ready to destroy.

Frequently asked questions

What is Google Cloud Bigtable Instance?

Google Cloud Bigtable Instance 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 Instance?

For Terraform, the codecentric/gcloud-scale-dev-friday, alisahp/gcp and marcelopicarelli/google-datalake 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.