provider/digitalocean: Reassign Floating IP when droplet changes (#7411)

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
pull/7343/head
Paul Stack 10 years ago committed by GitHub
parent 21618a9111
commit 7a1b78593b

@ -122,6 +122,8 @@ func resourceDigitalOceanFloatingIpRead(d *schema.ResourceData, meta interface{}
log.Printf("[INFO] A droplet was detected on the FloatingIP so setting the Region based on the Droplet")
log.Printf("[INFO] The region of the Droplet is %s", floatingIp.Droplet.Region.Slug)
d.Set("region", floatingIp.Droplet.Region.Slug)
d.Set("droplet_id", floatingIp.Droplet.ID)
} else {
d.Set("region", floatingIp.Region.Slug)
}

Loading…
Cancel
Save