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_container_cluster hits 400 when using a network with self_link #5552

Closed
devth opened this issue Mar 10, 2016 · 4 comments
Closed

google_container_cluster hits 400 when using a network with self_link #5552

devth opened this issue Mar 10, 2016 · 4 comments

Comments

@devth
Copy link

devth commented Mar 10, 2016

google_container_cluster: {
  ...
  network: "${google_compute_network.test.self_link"
}

Trying to apply results in:

* google_container_cluster.us-central1-c-standard-test-private: googleapi: Error 400: network "https://www.googleapis.com/compute/v1/projects/.../global/networks/test-m" does not exist., badRequest

The prod network exists for sure. When I refresh tf state, it shows up. It also shows up in the list of networks from google compute networks list.

@devth
Copy link
Author

devth commented Mar 10, 2016

It works if I do this instead:

google_container_cluster: {
  ...
  network: "test-m"
}

test is the network name in terraform inventory, test-m is the actual resource name in GCP.

@sl1pm4t
Copy link
Contributor

sl1pm4t commented Mar 31, 2016

The Google API expects the name of the network, not the resource URL.
Does it work if you change your resource definition to:

google_container_cluster: {
  ...
  network: "${google_compute_network.test.name"
}

sl1pm4t added a commit to sl1pm4t/terraform that referenced this issue Sep 4, 2016
sl1pm4t added a commit to sl1pm4t/terraform that referenced this issue Sep 4, 2016
Some google resources required network be refernced by resource URL (aka self_link), while others required network name.
This change allows either to be supplied.

DRY it out, and add a fix for hashicorp#5552.
@paddycarver
Copy link
Contributor

This should now work with either the self_link or the name, thanks to @sl1pm4t's work, so I'm going to close this issue out. If you encounter more problems, feel free to open another issue or comment in this issue again, and we'll reopen it. Thanks!

@ghost
Copy link

ghost commented Apr 20, 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 20, 2020
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

4 participants