Google Cloud BigTable Module
This module allows managing a single BigTable instance, including access configuration and tables.
TODO
Examples
Instance with access configuration
module "bigtable-instance" {
source = "./fabric/modules/bigtable-instance"
project_id = "my-project"
name = "instance"
cluster_id = "instance"
zone = "europe-west1-b"
tables = {
test1 = null,
test2 = {
split_keys = ["a", "b", "c"]
column_family = null
}
}
iam = {
"roles/bigtable.user" = ["user:viewer@testdomain.com"]
}
}
# tftest modules=1 resources=4
Instance with static number of nodes
module "bigtable-instance" {
source = "./fabric/modules/bigtable-instance"
project_id = "my-project"
name = "instance"
cluster_id = "instance"
zone = "europe-west1-b"
num_nodes = 5
}
# tftest modules=1 resources=1
Instance with autoscaling (based on CPU only)
module "bigtable-instance" {
source = "./fabric/modules/bigtable-instance"
project_id = "my-project"
name = "instance"
cluster_id = "instance"
zone = "europe-southwest1-b"
autoscaling_config = {
min_nodes = 3
max_nodes = 7
cpu_target = 70
}
}
# tftest modules=1 resources=1
Instance with autoscaling (based on CPU and/or storage)
module "bigtable-instance" {
source = "./fabric/modules/bigtable-instance"
project_id = "my-project"
name = "instance"
cluster_id = "instance"
zone = "europe-southwest1-a"
storage_type = "SSD"
autoscaling_config = {
min_nodes = 3
max_nodes = 7
cpu_target = 70
storage_target = 4096
}
}
# tftest modules=1 resources=1
Variables
name |
description |
type |
required |
default |
name |
The name of the Cloud Bigtable instance. |
string |
✓ |
|
project_id |
Id of the project where datasets will be created. |
string |
✓ |
|
zone |
The zone to create the Cloud Bigtable cluster in. |
string |
✓ |
|
autoscaling_config |
Settings for autoscaling of the instance. Only one of autoscaling_config or num_nodes should be set. If both are set, num_nodes is ignored. |
object({…}) |
|
null |
cluster_id |
The ID of the Cloud Bigtable cluster. |
string |
|
"europe-west1" |
deletion_protection |
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. |
|
|
true |
display_name |
The human-readable display name of the Bigtable instance. |
|
|
null |
iam |
IAM bindings for topic in {ROLE => [MEMBERS]} format. |
map(list(string)) |
|
{} |
instance_type |
(deprecated) The instance type to create. One of 'DEVELOPMENT' or 'PRODUCTION'. |
string |
|
null |
num_nodes |
The number of nodes in your Cloud Bigtable cluster. |
number |
|
1 |
storage_type |
The storage type to use. |
string |
|
"SSD" |
table_options_defaults |
Default option of tables created in the BigTable instance. |
object({…}) |
|
{…} |
tables |
Tables to be created in the BigTable instance, options can be null. |
map(object({…})) |
|
{} |
Outputs
name |
description |
sensitive |
id |
An identifier for the resource with format projects/{{project}}/instances/{{name}}. |
|
instance |
BigTable intance. |
|
table_ids |
Map of fully qualified table ids keyed by table name. |
|
tables |
Table resources. |
|