Skip to content

Commit

Permalink
Removed deprecated variable and added labels (#1923)
Browse files Browse the repository at this point in the history
Co-authored-by: Ludovico Magnocavallo <ludomagno@google.com>
  • Loading branch information
luigi-bitonti and ludoo committed Dec 12, 2023
1 parent 1dc6965 commit ef4095f
Show file tree
Hide file tree
Showing 4 changed files with 11 additions and 12 deletions.
2 changes: 1 addition & 1 deletion modules/bigtable-instance/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -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. | <code>bool</code> | | <code>true</code> |
| [display_name](variables.tf#L63) | The human-readable display name of the Bigtable instance. | <code>string</code> | | <code>null</code> |
| [iam](variables.tf#L69) | IAM bindings for topic in {ROLE => [MEMBERS]} format. | <code>map&#40;list&#40;string&#41;&#41;</code> | | <code>&#123;&#125;</code> |
| [instance_type](variables.tf#L75) | (deprecated) The instance type to create. One of 'DEVELOPMENT' or 'PRODUCTION'. | <code>string</code> | | <code>null</code> |
| [labels](variables.tf#L75) | Labels to be attached to the instance. | <code>map&#40;string&#41;</code> | | <code>&#123;&#125;</code> |
| [tables](variables.tf#L91) | Tables to be created in the BigTable instance. | <code title="map&#40;object&#40;&#123;&#10; split_keys &#61; optional&#40;list&#40;string&#41;, &#91;&#93;&#41;&#10; column_families &#61; optional&#40;map&#40;object&#40;&#10; &#123;&#10; gc_policy &#61; optional&#40;object&#40;&#123;&#10; deletion_policy &#61; optional&#40;string&#41;&#10; gc_rules &#61; optional&#40;string&#41;&#10; mode &#61; optional&#40;string&#41;&#10; max_age &#61; optional&#40;string&#41;&#10; max_version &#61; optional&#40;string&#41;&#10; &#125;&#41;, null&#41;&#10; &#125;&#41;&#41;, &#123;&#125;&#41;&#10;&#125;&#41;&#41;">map&#40;object&#40;&#123;&#8230;&#125;&#41;&#41;</code> | | <code>&#123;&#125;</code> |

## Outputs
Expand Down
11 changes: 5 additions & 6 deletions modules/bigtable-instance/main.tf
Original file line number Diff line number Diff line change
@@ -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.
Expand Down Expand Up @@ -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
Expand Down
2 changes: 1 addition & 1 deletion modules/bigtable-instance/outputs.tf
Original file line number Diff line number Diff line change
@@ -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.
Expand Down
8 changes: 4 additions & 4 deletions modules/bigtable-instance/variables.tf
Original file line number Diff line number Diff line change
Expand Up @@ -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" {
Expand Down

0 comments on commit ef4095f

Please sign in to comment.