-
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
Cannot delete google_compute_address when it's a dependency of google_compute_router_nat #6812
Cannot delete google_compute_address when it's a dependency of google_compute_router_nat #6812
Comments
I can repro this issue
|
|
Looks like this is the same basic problem as #6376 Unfortunately there is not a great option for resolving this permanently. We could split out a fine-grained resource similar to the suggestion in that other issue, allowing us to update Alternatively we could mark Given that this resource doesn't lend itself to a fine-grained resource (due to the requirement of a nat_ip at create time that you noted) I'd lean towards making this field |
Hum unfortunately recreating the whole NAT resource would render a somewhat "seamless change" (minus a drain), disruptive, if we're talking real live operation. Which bring another concept on the table actually, we could have an |
Hi, has there been any development regarding this issue? |
…corp#6812) Signed-off-by: Modular Magician <[email protected]>
#13489) Signed-off-by: Modular Magician <[email protected]> Signed-off-by: Modular Magician <[email protected]>
Hello everyone! I am currently working on the creation of a new fine grained resource for this issue, but one problem I am facing is that since the new resource is only really separating the nat_ips field, which just references the addresses directly, the result is that the new resource just faces the same dependency problem when removing the addresses. While I work on this, is the usage of a random_id for the addresses (as described here) a viable workaround for the time being? Example:
|
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
Terraform v0.12.26
Affected Resource(s)
Terraform Configuration Files
Expected Behavior
When lowering the count in
google_compute_address
, the resourcegoogle_compute_router_nat
should be updated first then the oldgoogle_compute_address
resources must be destroyedActual Behavior
Since
google_compute_address
is a dependency ofgoogle_compute_router_nat
, Terraform try to destroy the addresses first but failed since they are still in use by the NAT resource.Steps to Reproduce
Note that the .tf has been adapted with fake "locals" for convenience.
count
ingoogle_compute_address
to 1terraform plan/apply
Important Factoids
I don't see an easy way out of that, but we could have an intermediate
google_compute_router_nat_ip_attachment
so that we could destroy the ip_attachment, then the address without causing dependency cycles.However, the
google_compute_router_nat
must have at least one IP when first created, so it still need to come with anat_ips
parameter.References
It's similar in nature to #6376
The text was updated successfully, but these errors were encountered: