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

Upgrading Big Table from DEV to PROD #3416

Closed
michyliao opened this issue Apr 11, 2019 · 3 comments
Closed

Upgrading Big Table from DEV to PROD #3416

michyliao opened this issue Apr 11, 2019 · 3 comments

Comments

@michyliao
Copy link
Contributor

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.

My Issue

Hi all, has anyone upgraded their big table instance from DEVELOPMENT -> PRODUCTION in TF? Im noticing it when I do the change in TF, it recreates the instance, but when I manually upgrade on the console - and change the TF instance_type to PRODUCTION, it still recreates since the cluster.id has now changed. I want to keep the same cluster, but upgrade it to PRODUCTION.

I have originally created the cluster as a DEVELOPMENT instance in Terraform, but want to upgrade to PRODUCTION.

Terraform Version

0.11.13

Affected Resource(s)

  • google_2.3.0

Terraform Configuration Files


resource "google_bigtable_instance" "test_cluster" {
  project      = <project>
  name         = "test-upgade"
  cluster {
    cluster_id   = "test-cluster"
    zone         = "us-east1-b"
  }
  instance_type = "DEVELOPMENT"
}

Wanting to update the instnace_type to PRODUCTION

resource "google_bigtable_instance" "test_cluster" {
  project      = <project>
  name         = "test-upgade"
  cluster {
    cluster_id   = "test-cluster"
    zone         = "us-east1-b"
  }
  instance_type = "PRODUCTION"
}

Debug Output

Panic Output

Expected Behavior

Actual Behavior

-/+ google_bigtable_instance.dev_cluster (new resource required)
      id:                              "test-upgade" => <computed> (forces new resource)
      cluster.#:                       "1" => "1"
      cluster.2974130656.cluster_id:   "test-cluster" => "" (forces new resource)
      cluster.2974130656.num_nodes:    "3" => "0" (forces new resource)
      cluster.2974130656.storage_type: "SSD" => "" (forces new resource)
      cluster.2974130656.zone:         "us-east1-b" => "" (forces new resource)
      cluster.982949881.cluster_id:    "" => "test-cluster" (forces new resource)
      cluster.982949881.num_nodes:     "" => ""
      cluster.982949881.storage_type:  "" => "SSD" (forces new resource)
      cluster.982949881.zone:          "" => "us-east1-b" (forces new resource)
      cluster_id:                      "" => <computed>
      display_name:                    "test-upgade" => <computed>
      instance_type:                   "DEVELOPMENT" => "PRODUCTION" (forces new resource)
      name:                            "test-upgade" => "test-upgade"
      num_nodes:                       "" => <computed>
      project:                         "<PROJECT>" => "<PROJECT>"
      storage_type:                    "" => <computed>
      zone:                            "" => <computed>

Steps to Reproduce

  1. terraform apply

Important Factoids

References

  • #0000
@ghost ghost added the bug label Apr 11, 2019
@emilymye
Copy link
Contributor

I think there are two issues here - one we could fix but it may take a little longer.

InstanceType is a input-only field, i.e. it cannot be changed after creation. It sounds like both gcloud and TF are recreating the instance, which seems like the intended behavior. Thus, we won't be able to support in-place instance type changes regardless.

However, we seem to be using the Go library that does not expose the InstanceType on read (see API method). Thus, when you changed the instance in gcloud and changed your Terraform config to match, it didn't work because we can't read InstanceType as is. We have been moving a lot of our APIs to just use HTTP requests, which would make us able to read it but this isn't the quickest fix for something that could have been avoided by not recreating the instance outside of Terraform.

@michyliao
Copy link
Contributor Author

Seems like this issue is getting tracked here: #2521 Closing this issue

@ghost
Copy link

ghost commented May 17, 2019

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 👉 hashibot-feedback@hashicorp.com. Thanks!

@ghost ghost locked and limited conversation to collaborators May 17, 2019
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

No branches or pull requests

2 participants