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_route forces new resource for next_hop_instance #677

Closed
hashibot opened this issue Nov 3, 2017 · 2 comments · Fixed by #716
Closed

google_compute_route forces new resource for next_hop_instance #677

hashibot opened this issue Nov 3, 2017 · 2 comments · Fixed by #716
Assignees
Labels

Comments

@hashibot
Copy link

hashibot commented Nov 3, 2017

This issue was originally opened by @mwallman as hashicorp/terraform#16508. It was migrated here as a result of the provider split. The original body of the issue is below.


Terraform Version

Terraform v0.10.8

Terraform Configuration Files

resource "google_compute_route" "route" {
  name = "${var.name}-route"
  network = "${var.network}"
  dest_range = "0.0.0.0/0"
  priority = "${var.priority}"
  next_hop_instance = "${google_compute_instance.nat.self_link}"
  next_hop_instance_zone = "${var.zone}"
  tags = "${var.route_tags}"
}

Expected Behavior

Nothing, because nothing changed.

Actual Behavior

Terraform will perform the following actions:

  + google_compute_route.route
      id:                     <computed>
      dest_range:             "0.0.0.0/0"
      name:                   "us-west1-a-nat-route"
      network:                "https://www.googleapis.com/compute/v1/projects/marketo-network-dev/global/networks/dev-vpc"
      next_hop_instance:      "https://www.googleapis.com/compute/v1/projects/marketo-network-dev/zones/us-west1-a/instances/us-west1-a-nat"
      next_hop_instance_zone: "us-west1-a"
      next_hop_network:       <computed>
      priority:               "800"
      self_link:              <computed>
      tags.#:                 "1"
      tags.1668485976:        "us-west1-nat-external"

  - module.us-west1-a-nat.google_compute_route.route


Plan: 1 to add, 0 to change, 1 to destroy.

**It recreates the instance, and hence the route, on each apply

Steps to Reproduce

Please list the full steps required to reproduce the issue, for example:

  1. terraform plan
@rosbo
Copy link
Contributor

rosbo commented Nov 9, 2017

Hi @mwallman,

I opened a PR to fix this issue.

As a workaround, you can update your config to use the instance name instead of the self_link.

Your configuration would look like this:

resource "google_compute_route" "route" {
  name = "${var.name}-route"
  network = "${var.network}"
  dest_range = "0.0.0.0/0"
  priority = "${var.priority}"
  next_hop_instance = "${google_compute_instance.nat.name}"
  next_hop_instance_zone = "${var.zone}"
  tags = "${var.route_tags}"
}

My fix (#716) will allow users to use the instance name or the instance self_link in the next_hop_instance field.

luis-silva pushed a commit to luis-silva/terraform-provider-google that referenced this issue May 21, 2019
Signed-off-by: Modular Magician <magic-modules@google.com>
@ghost
Copy link

ghost commented Mar 30, 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 Mar 30, 2020
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants