Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Bigtable module only allows a single column family #1064

Closed
iht opened this issue Dec 22, 2022 · 2 comments · Fixed by #1069
Closed

Bigtable module only allows a single column family #1064

iht opened this issue Dec 22, 2022 · 2 comments · Fixed by #1069
Assignees
Labels
bug Something isn't working on:modules

Comments

@iht
Copy link
Member

iht commented Dec 22, 2022

A Bigtable table may contain more than one column family (tens and hundreds even). The current module implementation only creates the latest column family specified in the tables option.

For instance:

module "my-bigtable-instance" {
 [...]
  tables = {
    test1 = {
      column_family = "cf1"
      column_family = "cf2"
      column_family = "cf3"
    }
  }
}

The output of tf plan is:

  + resource "google_bigtable_table" "default" {
      [...]
      + column_family {
          + family = "cf3"
        }
    }

The output should be something like this:

  + resource "google_bigtable_table" "default" {
      [...]
      + column_family {
          + family = "cf1"
        }
      + column_family {
          + family = "cf2"
        }
      + column_family {
          + family = "cf3"
        }
    }

The option split_keys should also be optional for each column family.

The documentation of the resource google_bigtable_table specifies that the option column_family can be specified several times.

@iht iht added the bug Something isn't working label Dec 22, 2022
@iht iht self-assigned this Dec 22, 2022
@ludoo
Copy link
Collaborator

ludoo commented Dec 22, 2022

Thanks for catching this Israel, care to send a PR? We can do it together if you prefer.

@iht
Copy link
Member Author

iht commented Dec 22, 2022

Thanks for catching this Israel, care to send a PR? We can do it together if you prefer.

I am on it :)

iht added a commit to iht/cloud-foundation-fabric that referenced this issue Dec 22, 2022
iht added a commit to iht/cloud-foundation-fabric that referenced this issue Dec 22, 2022
This commit fixes GoogleCloudPlatform#1064 by allowing to add more than one column family. Split
keys are also now optional, and there is no possibility to set defaults for all
tables (since keys and column families are related to the data and schema for
each table, it is difficult that several tables share the same values).

Also, declaring a table with no split keys nor column families requires
initializing the table to an empty map, instead of using null.
iht added a commit to iht/cloud-foundation-fabric that referenced this issue Dec 22, 2022
This commit fixes GoogleCloudPlatform#1064 by allowing to add more than one column family. Split
keys are also now optional, and there is no possibility to set defaults for all
tables (since keys and column families are related to the data and schema for
each table, it is difficult that several tables share the same values).

Also, declaring a table with no split keys nor column families requires
initializing the table to an empty map, instead of using null.
@iht iht closed this as completed in #1069 Dec 22, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working on:modules
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants