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

google_sql_database_instance should recreate going private -> public #2964

Closed
rileykarson opened this issue Jan 30, 2019 · 4 comments · Fixed by GoogleCloudPlatform/magic-modules#3882, #7054 or hashicorp/terraform-provider-google-beta#2400
Assignees
Labels

Comments

@rileykarson
Copy link
Collaborator

rileykarson commented Jan 30, 2019

This "upgrade" path isn't supported, but going public -> private is. We return an API error today, we should have plan show that that's ForceNew by using CustomizeDiff if possible.

Specifically, private_network can't go from having a value to no value; this might be infeasible if setting a diff ForceNew requires the field to be Computed.

@rileykarson
Copy link
Collaborator Author

It should also recreate if the private_network is in another project (shared VPC) going public -> private

@danawillow
Copy link
Contributor

@edwardmedia @venkykuberan can one of you check on this?

@edwardmedia edwardmedia self-assigned this Aug 10, 2020
@edwardmedia
Copy link
Contributor

edwardmedia commented Aug 12, 2020

@rileykarson yes, it works when public -> private But it does not work when private -> public Below plan shows it is not for recreate

  # google_sql_database_instance.instance will be updated in-place
  ~ resource "google_sql_database_instance" "instance" {
...
          ~ ip_configuration {
              ~ ipv4_enabled    = false -> true
              - private_network = "projects/myprojectglobal/networks/issue2964private-network" -> null
                require_ssl     = false
            }
        }
    }
Error: Error, failed to update instance settings for : googleapi: Error 400: This operation is not valid for this instance., invalidOperation

terraform-provider-google-beta_v3.34.0

@ghost
Copy link

ghost commented Sep 18, 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 👉 hashibot-feedback@hashicorp.com. Thanks!

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