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

DigitalOcean floating IPs aren't reassigned if altered outside of Terraform #6673

Closed
mrcrilly opened this issue May 15, 2016 · 1 comment · Fixed by #7411
Closed

DigitalOcean floating IPs aren't reassigned if altered outside of Terraform #6673

mrcrilly opened this issue May 15, 2016 · 1 comment · Fixed by #7411

Comments

@mrcrilly
Copy link

Hey,

IP addresses included in this report aren't live

I've noticed that if I create a floating IP in DigitalOcean via Terraform, and then manually/externally alter it (I've been doing it via the DO web UI), Terraform does not see the change and put the floating IP back into place.

Terraform Version

$ terraform -v
Terraform v0.6.16

Affected Resource(s)

  • digitalocean_droplet
  • digitalocean_floating_ip

This doesn't strictly effect digitalocean_droplet, but I figure it's worth mentioning as I'm obviously attaching the FIP to a specific Droplet.

Terraform Configuration Files

This configuration (which I'm using inside of a module) is sufficient to replicate the issue:

provider "digitalocean" {}

resource "digitalocean_droplet" "haproxy-primary" {
  image = "centos-7-0-x64"
  name = "haproxy-primary"
  region = "sgp1"
  size = "512mb"
  ssh_keys = ["1234567890"]
  private_networking = true
}

resource "digitalocean_floating_ip" "primary" {
  droplet_id = "${digitalocean_droplet.haproxy-primary.id}"
  region = "sgp1"
}

resource "digitalocean_droplet" "haproxy-secondary" {
  image = "centos-7-0-x64"
  name = "haproxy-secondary"
  region = "sgp1"
  size = "512mb"
  ssh_keys = ["1234567890"]
  private_networking = true
}

resource "digitalocean_floating_ip" "secondary" {
  droplet_id = "${digitalocean_droplet.haproxy-secondary.id}"
  region = "sgp1"
}

resource "digitalocean_droplet" "haproxy-tertiary" {
  image = "centos-7-0-x64"
  name = "haproxy-tertiary"
  region = "sgp1"
  size = "512mb"
  ssh_keys = ["1234567890"]
  private_networking = true
}

resource "digitalocean_floating_ip" "tertiary" {
  droplet_id = "${digitalocean_droplet.haproxy-tertiary.id}"
  region = "sgp1"
}

Debug Output

https://gist.github.com/mrcrilly/ee9e487f0bda4a64042e4c1ca635f493

Expected Behavior

I would expect the DigitalOcean provider to see the floating IP is not pointed at the resource it is in the Terraform code, and readjust it accordingly.

Actual Behavior

Terraform does not see the change and reports everything as working OK.

Steps to Reproduce

  1. terraform apply
  2. Use the DO API or web UI to reassign the floating to another box;
  3. terraform plan or terraform apply

You should see that Terraform does not recognise the change.

stack72 added a commit that referenced this issue Jun 29, 2016
Fixes #6673

When a floating IP is changed in the DO console, this PR will allow it
to be reassociated to the machine that Terraform attached it to and
change it back
@stack72 stack72 self-assigned this Jun 29, 2016
stack72 added a commit that referenced this issue Jun 29, 2016
Fixes #6673

When a floating IP is changed in the DO console, this PR will allow it
to be reassociated to the machine that Terraform attached it to and
change it back
@ghost
Copy link

ghost commented Apr 24, 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 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.

@ghost ghost unassigned stack72 Apr 24, 2020
@ghost ghost locked and limited conversation to collaborators Apr 24, 2020
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants