From 6009de40cb734f4758f34dbe70dcb5dc63d3430e Mon Sep 17 00:00:00 2001 From: Israel Herraiz Date: Thu, 22 Dec 2022 16:33:29 +0100 Subject: [PATCH] Make tables optional and forbid it to be set to null --- modules/bigtable-instance/README.md | 4 ++-- modules/bigtable-instance/variables.tf | 2 ++ 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/modules/bigtable-instance/README.md b/modules/bigtable-instance/README.md index 076526c7..494a7a98 100644 --- a/modules/bigtable-instance/README.md +++ b/modules/bigtable-instance/README.md @@ -124,8 +124,7 @@ module "bigtable-instance" { |---|---|:---:|:---:|:---:| | [name](variables.tf#L56) | The name of the Cloud Bigtable instance. | string | ✓ | | | [project_id](variables.tf#L67) | Id of the project where datasets will be created. | string | ✓ | | -| [tables](variables.tf#L78) | Tables to be created in the BigTable instance. | map(object({…})) | ✓ | | -| [zone](variables.tf#L86) | The zone to create the Cloud Bigtable cluster in. | string | ✓ | | +| [zone](variables.tf#L88) | The zone to create the Cloud Bigtable cluster in. | string | ✓ | | | [autoscaling_config](variables.tf#L17) | Settings for autoscaling of the instance. If you set this variable, the variable num_nodes is ignored. | object({…}) | | null | | [cluster_id](variables.tf#L28) | The ID of the Cloud Bigtable cluster. | string | | "europe-west1" | | [deletion_protection](variables.tf#L34) | 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 | @@ -134,6 +133,7 @@ module "bigtable-instance" { | [instance_type](variables.tf#L50) | (deprecated) The instance type to create. One of 'DEVELOPMENT' or 'PRODUCTION'. | string | | null | | [num_nodes](variables.tf#L61) | The number of nodes in your Cloud Bigtable cluster. This value is ignored if you are using autoscaling. | number | | 1 | | [storage_type](variables.tf#L72) | The storage type to use. | string | | "SSD" | +| [tables](variables.tf#L78) | Tables to be created in the BigTable instance. | map(object({…})) | | {} | ## Outputs diff --git a/modules/bigtable-instance/variables.tf b/modules/bigtable-instance/variables.tf index 01c491b2..ac92c326 100644 --- a/modules/bigtable-instance/variables.tf +++ b/modules/bigtable-instance/variables.tf @@ -77,10 +77,12 @@ variable "storage_type" { variable "tables" { description = "Tables to be created in the BigTable instance." + nullable = false type = map(object({ split_keys = optional(list(string), []) column_families = optional(list(string), []) })) + default = {} } variable "zone" {