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_vpn_gateway does not work if region not specified #5027

Closed
clstokes opened this issue Feb 6, 2016 · 4 comments
Closed

google_compute_vpn_gateway does not work if region not specified #5027

clstokes opened this issue Feb 6, 2016 · 4 comments

Comments

@clstokes
Copy link
Contributor

clstokes commented Feb 6, 2016

When trying to create a google_compute_vpn_gateway resource, if the region is not specified, Terraform will create the VPN gateway, but is then unable to read it (a 404 is returned) and no error is reported. At this point, the gateway has been created, but the gateway's details are not persisted in Terraform's state. Subsequent applies and destroys will fail.

If I specify the region (commented below), Terraform works fine. It seems that resourceComputeVpnGatewayRead() should be reading the region from getOptionalRegion() as other Google resources do. In fact, changing this locally fixes this, but I'm unsure if there are other implications of this change.

google_compute_vpn_gateway
resource "google_compute_network" "main" {
  name = "tf-test"
  ipv4_range = "172.17.0.0/16"
}

resource "google_compute_address" "vpn" {
  name = "tf-test"
}

resource "google_compute_vpn_gateway" "vpn" {
  name = "tf-test"
  network = "${google_compute_network.main.self_link}"
  #region = "us-central1"
}
google_compute_vpn_tunnel

This occurs for google_compute_vpn_tunnel too. Full config to reproduce is at https://gist.github.com/clstokes/7b89b5542c02deedddc6.

Docs issue (?)

The compute_vpn_gateway docs say If not specified, the project region will be used. where other resources say If it is not provided, the provider region is used. I'm not sure if this is a typo or there actually is a distinction between project and provider region.

@clstokes
Copy link
Contributor Author

clstokes commented Feb 6, 2016

Edited to include details about google_compute_vpn_tunnel too.

@lwander
Copy link
Contributor

lwander commented Feb 13, 2016

Good catch! Submitted a fix #5125

@jen20
Copy link
Contributor

jen20 commented Feb 17, 2016

Fixed by #5125 - nice catch @clstokes!

@jen20 jen20 closed this as completed Feb 17, 2016
@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

No branches or pull requests

4 participants