-
Notifications
You must be signed in to change notification settings - Fork 9.7k
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
DigitalOcean floating IP destroyed on droplet refresh #4299
Comments
@franklinhu so the behaviour is as follows:
Is this correct? This seems correct to me. Terraform is trying to basically cleanup after itself. If the droplet is no longer needed then Terraform is trying to cleanup the no longer needed Floating IP. Is this not the case you were looking for? |
For my particular use case, I want to use a floating IP that never changes since I've pointed DNS at it. Changes to the DNS record have unknown propagation time given client caching, so they may cause for my app to be unreachable. It feels like it'd be nice if the droplet configuration allowed you to specify a floating IP to use, but not sure if that's feasible. |
ok i see what you mean. So right now you would want to do something like:
|
Yep! |
Not sure it's worth inverting the relationship. The main problem is that a It should be a oneline change ( https://github.com/hashicorp/terraform/blob/master/builtin/providers/digitalocean/resource_digitalocean_floating_ip.go#L35 ) |
DigitalOcean API does not let you specify ip address when creating a droplet. Instead, there is another API for assigning floating ip to droplet: https://developers.digitalocean.com/documentation/v2/#assign-a-floating-ip-to-a-droplet. I think DO API should allow floating_ip when creating a droplet... (I posted the idea on their uservoice site) but until that terraform should take care of it. I'm not sure what is the "terraform" way to handle this. Does terraform have convention that each resource should map to a provider's resource?
|
The exact same system exists in AWS with elastic IPs. EIPs are simply a different resource (same for floating IPs) in the provider, which is convenient because they are actually a different element in both AWS and Digital Ocean. Option 1 disregards entirely the fact that the floating IP (or elastic IP) is an independent resource |
Hi all Can someone tell me if this is an issue? Paul |
Closing for now - if this is still an issue then we can reopen |
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. |
This is related to: #2011
Following the example in the docs [0], I'm seeing behavior where terraform destroys a floating IP if the upstream droplet is changed. This seems pretty undesirable since floating IPs are supposed to be static across infrastructure changes, so it seems like the relationship between droplets and floating IPs should be inverted.
[0] https://terraform.io/docs/providers/do/r/floating_ip.html
The text was updated successfully, but these errors were encountered: