-
Notifications
You must be signed in to change notification settings - Fork 1.8k
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
Setting ip_address to IPv6 for google_compute_forwarding_rule causes recreation #15916
Setting ip_address to IPv6 for google_compute_forwarding_rule causes recreation #15916
Comments
Yes, this is a bug
The diff suppress function needs update |
Below format is possible and legit
|
In my experiments, all of these are accepted by both Terraform and the Google API, but they also all result in the forwarding rule being recreated on every run of
If I use the |
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. |
Community Note
modular-magician
user, it is either in the process of being autogenerated, or is planned to be autogenerated soon. If an issue is assigned to a user, that user is claiming responsibility for the issue. If an issue is assigned tohashibot
, a community member has claimed the issue already.Terraform Version
Affected Resource(s)
Terraform Configuration Files
Debug Output
https://gist.github.com/nkinkade/aaccc5ae60d2d3e1b134c9ed24af608c
Panic Output
Expected Behavior
It should be possible to assign the address attribute of a static IPv6
google_compute_address
resource as theip_address
argument ofgoogle_compute_forwarding_rule
without the forwarding rule being recreated on every run ofterraform apply
, even it nothing has changed.Actual Behavior
On every run of
terraform apply
thegoogle_compute_forwarding_rule
is recreated, even when nothing has changed about the Terraform configuration.The underlying issue seems to be that the
address
field/attribute of an IPv6google_compute_address
resource will use abbreviated IPv6 notation, collapsing all-zero "hextets" and without a prefix value e.g.,2600:1900:4020:31cd:8000::
. However, the API appears to expand theip_address
argument (IPAddress field) of agoogle_compute_forwarding_rule
such that the above example IPv6google_compute_address
is stored as2600:1900:4020:31cd:8000:0:0:0/96
. Terraform (or perhaps the API?) sees these as two different addresses/values and wants to recreate the forwarding rule using the abbreviated address value, as stored in thegoogle_compute_address
resource. This will happen as many times as you runterraform apply
.Using
google_compute_address.my_ipv6_addr.id
orgoogle_compute_address.my_ipv6_addr.self_link
as the value ofip_address
in the forwarding rule creates a similar problem, but more like the one described in #7841.Details of the created resources as reported by
gcloud
(abbreviated to relevant fields):Steps to Reproduce
google_compute_address
resource (e.g.,google_compute_address.my_ipv6_addr
)${google_compute_address.my_ipv6_addr.address}/96
as the value of theip_address
argument of agoogle_compute_forwarding_rule
resource.terraform apply
... the forwarding rule resources will be recreated.terraform apply
... the forwarding rule resource will be recreated.Important Factoids
Nothing special.
References
The text was updated successfully, but these errors were encountered: