From ef4095f0004bdb041ac8d2dc96b2ee2009e1df14 Mon Sep 17 00:00:00 2001 From: luigi-bitonti <93377317+luigi-bitonti@users.noreply.github.com> Date: Tue, 12 Dec 2023 19:32:48 +0100 Subject: [PATCH] Removed deprecated variable and added labels (#1923) Co-authored-by: Ludovico Magnocavallo --- modules/bigtable-instance/README.md | 2 +- modules/bigtable-instance/main.tf | 11 +++++------ modules/bigtable-instance/outputs.tf | 2 +- modules/bigtable-instance/variables.tf | 8 ++++---- 4 files changed, 11 insertions(+), 12 deletions(-) diff --git a/modules/bigtable-instance/README.md b/modules/bigtable-instance/README.md index 703810a0..05dcbdde 100644 --- a/modules/bigtable-instance/README.md +++ b/modules/bigtable-instance/README.md @@ -237,7 +237,7 @@ module "bigtable-instance" { | [deletion_protection](variables.tf#L56) | 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. | bool | | true | | [display_name](variables.tf#L63) | The human-readable display name of the Bigtable instance. | string | | null | | [iam](variables.tf#L69) | IAM bindings for topic in {ROLE => [MEMBERS]} format. | map(list(string)) | | {} | -| [instance_type](variables.tf#L75) | (deprecated) The instance type to create. One of 'DEVELOPMENT' or 'PRODUCTION'. | string | | null | +| [labels](variables.tf#L75) | Labels to be attached to the instance. | map(string) | | {} | | [tables](variables.tf#L91) | Tables to be created in the BigTable instance. | map(object({…})) | | {} | ## Outputs diff --git a/modules/bigtable-instance/main.tf b/modules/bigtable-instance/main.tf index 3a00eab8..309bbb1a 100644 --- a/modules/bigtable-instance/main.tf +++ b/modules/bigtable-instance/main.tf @@ -1,5 +1,5 @@ /** - * Copyright 2022 Google LLC + * Copyright 2023 Google LLC * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -36,12 +36,11 @@ locals { } resource "google_bigtable_instance" "default" { - project = var.project_id - name = var.name - - instance_type = var.instance_type - display_name = var.display_name == null ? var.display_name : var.name + project = var.project_id + name = var.name + display_name = coalesce(var.display_name, var.name) deletion_protection = var.deletion_protection + labels = var.labels dynamic "cluster" { for_each = local.clusters_autoscaling diff --git a/modules/bigtable-instance/outputs.tf b/modules/bigtable-instance/outputs.tf index a2fd2646..5cfabd6a 100644 --- a/modules/bigtable-instance/outputs.tf +++ b/modules/bigtable-instance/outputs.tf @@ -1,5 +1,5 @@ /** - * Copyright 2022 Google LLC + * Copyright 2023 Google LLC * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/modules/bigtable-instance/variables.tf b/modules/bigtable-instance/variables.tf index d8567766..132d5c2c 100644 --- a/modules/bigtable-instance/variables.tf +++ b/modules/bigtable-instance/variables.tf @@ -72,10 +72,10 @@ variable "iam" { default = {} } -variable "instance_type" { - description = "(deprecated) The instance type to create. One of 'DEVELOPMENT' or 'PRODUCTION'." - type = string - default = null +variable "labels" { + description = "Labels to be attached to the instance." + type = map(string) + default = {} } variable "name" {