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 compute network forces new resource with no changes #5233

Closed
kendawg2 opened this issue Feb 20, 2016 · 5 comments · Fixed by #5241
Closed

-/+ Google compute network forces new resource with no changes #5233

kendawg2 opened this issue Feb 20, 2016 · 5 comments · Fixed by #5241

Comments

@kendawg2
Copy link

With the addition of subnets (awesome btw) it has created an undesired backwards incompatibility with existing networks. This should be either ignored or updated in existing networks. The following was received from a terraform plan

-/+ google_compute_network.internal
    auto_create_subnetworks: "" => "0" (forces new resource)
    gateway_ipv4:            "10.60.0.1" => "<computed>"
    ipv4_range:              "10.60.0.0/16" => "10.60.0.0/16"
    name:                    "internal-network" => "internal-network"

Although this new auto_create_subnetworks is a new field, and it is in fact missing from legacy networks, it should not force a new resource or it will destroy existing networks.

@kendawg2
Copy link
Author

@sl1pm4t following up with a bit more detail. This is an existing legacy network. The terraform code that created it is as follows:

resource "google_compute_network" "internal" {
name = "internal-network"
ipv4_range = "10.60.0.0/16"

}

What appears to happening is that the optional "auto_create_subnetworks" is being added, even though this should be detected as a legacy network. It is setting it to the default value of "false" but in this case, it should definitely not be adding it. This will effectively break all existing GCE infrastructure if indeed this forces a new resource (It will attempt to destroy the existing network which every server relies on) . I believe the code reflects that element being added unconditionally but only forces it if it's a custom subnet network.

I hope this helps.

It might be practical to require "auto_create_subnetworks" in the network resource whenever a subnet network is created and if it's absent AND " ipv4_range" is defined it is defined as a legacy network.

@kendawg2
Copy link
Author

I should mention it is version 0.6.12 and the commit that added GH-5130 is causing this issue. A great new feature by the way.

@sl1pm4t
Copy link
Contributor

sl1pm4t commented Feb 22, 2016

Thanks for the info @kendawg2 - I didn't notice this issue until you tagged me, but I'll have a look.

@sl1pm4t
Copy link
Contributor

sl1pm4t commented Feb 22, 2016

I submitted a fix

@ghost
Copy link

ghost commented Apr 28, 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 have found a problem that seems similar to this, please open a new issue and complete the issue template so we can capture all the details necessary to investigate further.

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

Successfully merging a pull request may close this issue.

3 participants