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
This commit is contained in:
Paul Stack 2016-06-29 16:05:36 +01:00 committed by GitHub
parent 21618a9111
commit 7a1b78593b
1 changed files with 2 additions and 0 deletions

View File

@ -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)
}