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

Adding a Bigtable column family to an existing table forces replacement #5759

Closed
chetaldrich opened this issue Feb 25, 2020 · 3 comments · Fixed by GoogleCloudPlatform/magic-modules#3411, #6188 or hashicorp/terraform-provider-google-beta#1988

Comments

@chetaldrich
Copy link

Community Note

  • Please vote on this issue by adding a 👍 reaction to the original issue to help the community and maintainers prioritize this request.
  • Please do not leave +1 or me too comments, they generate extra noise for issue followers and do not help prioritize the request.
  • If you are interested in working on this issue or have submitted a pull request, please leave a comment.
  • If an issue is assigned to the modular-magician user, it is either in the process of being autogenerated, or is planned to be autogenerated soon. If an issue is assigned to a user, that user is claiming responsibility for the issue. If an issue is assigned to hashibot, a community member has claimed the issue already.

Terraform Version

Terraform v0.12.20
+ provider.aws v2.49.0
+ provider.google v3.8.0
+ provider.google-beta v3.8.0
+ provider.random v2.2.1
+ provider.template v2.1.2

Affected Resource(s)

  • google_bigtable_table

Terraform Configuration Files

# Copy-paste your Terraform configurations here.
#
# For large Terraform configs, please use a service like Dropbox and share a link to the ZIP file.
# For security, you can also encrypt the files using our GPG public key:
#    https://www.hashicorp.com/security
#
# If reproducing the bug involves modifying the config file (e.g., apply a config,
# change a value, apply the config again, see the bug), then please include both:
# * the version of the config before the change

resource "google_bigtable_table" "some_table" {
  name          = "stuff"
  instance_name = google_bigtable_instance.some_bigtable.name
  project       = google_project.project.project_id
  column_family {
    family = "family1"
  }
  column_family {
    family = "family2"
  }
}

# * the version of the config after the change.

resource "google_bigtable_table" "some_table" {
  name          = "stuff"
  instance_name = google_bigtable_instance.some_bigtable.name
  project       = google_project.project.project_id
  column_family {
    family = "family1"
  }
  column_family {
    family = "family2"
  }
  column_family {
    family = "family3"
  }
}

Plan Output

  # module.some_project.google_bigtable_table.stuff must be replaced
-/+ resource "google_bigtable_table" "some_table" {
      ~ id            = "projects/some-google-project/instances/some-bigtable/tables/stuff" -> (known after apply)
        instance_name = "some-bigtable"
        name          = "stuff"
        project       = "some-google-project"

        column_family {
            family = "family1"
        }
        column_family {
            family = "family2"
        }
      + column_family { # forces replacement
          + family = "family3"
        }
    }

Expected Behavior

The plan would indicate that we're creating a new column family and not replacing the table.

Actual Behavior

The plan indicates that we're forcing replacement of the whole table when adding a column family. cbt is capable of doing this, so Google likely has an API that doesn't force replacement when adding a new column family.

Steps to Reproduce

  1. Change the configuration to include a new column family on an existing Bigtable table.
  2. terraform plan
@ghost ghost added the bug label Feb 25, 2020
@venkykuberan venkykuberan self-assigned this Feb 25, 2020
@venkykuberan
Copy link
Contributor

@chetaldrich I am able to repro the behavior (and cbt adds the column family without deleting the table). Looking at the code we are forcenewing for cloumn_family attribute in our provider, we shouldn't be doing that . I will move this item for code change, it will be added to our sprint work once prioritized.

@emilymye
Copy link
Contributor

@ghost
Copy link

ghost commented May 24, 2020

I'm going to lock this issue because it has been closed for 30 days ⏳. This helps our maintainers find and focus on the active issues.

If you feel this issue should be reopened, we encourage creating a new issue linking back to this one for added context. If you feel I made an error 🤖 🙉 , please reach out to my human friends 👉 [email protected]. Thanks!

@ghost ghost locked and limited conversation to collaborators May 24, 2020
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.