Terraform: google_compute_route next_hop_network is not an input (doc error)

Created on 10 Mar 2016  ยท  6Comments  ยท  Source: hashicorp/terraform

https://www.terraform.io/docs/providers/google/r/compute_route.html

lists next_hop_network as an optional input. According to https://cloud.google.com/compute/docs/reference/latest/routes this is an output only.

Regards,

bug documentation providegoogle-cloud

All 6 comments

Hi @allandrick - thanks for the report.

I just checked, and it looks like we pass NextHopNetwork into the Route create API call. So perhaps the doc bug is on the upstream side?

https://github.com/hashicorp/terraform/blob/2dc1c022d3d77d8628ac9c13f21b21f048f5fb34/builtin/providers/google/resource_compute_route.go#L155

Let's check w/ @lwander here.

Looks like that attribute has been set like that since it was first added: https://github.com/hashicorp/terraform/blame/master/builtin/providers/google/resource_compute_route.go#L61. I don't think it's a docs error on the Google side, since it's possible to set attributes in the object sent the API that are simply ignored. @phinze, if we add computed: true to next_hop_network, and leave optional: true, will it break anyone's .tf file that has been supplying next_hop_network? Even though that field has likely been ignored by the API so far.

@lwander if the field has been ignored up until now, I think it's probably fine to just switch it straight to read only - since that should present a straightforward plan-time error. We can add a note to the top of the changelog to explain. What do you think?

SGTM!

PR fixing this was merged.

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.

Was this page helpful?
0 / 5 - 0 ratings

Related issues

glenjamin picture glenjamin  ยท  112Comments

radeksimko picture radeksimko  ยท  80Comments

phinze picture phinze  ยท  167Comments

amaczuga picture amaczuga  ยท  124Comments

ncraike picture ncraike  ยท  77Comments