Skip to content

Commit 7a1b785

Browse files
authored
provider/digitalocean: Reassign Floating IP when droplet changes (hashicorp#7411)
Fixes hashicorp#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
1 parent 21618a9 commit 7a1b785

1 file changed

Lines changed: 2 additions & 0 deletions

File tree

builtin/providers/digitalocean/resource_digitalocean_floating_ip.go

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -122,6 +122,8 @@ func resourceDigitalOceanFloatingIpRead(d *schema.ResourceData, meta interface{}
122122
log.Printf("[INFO] A droplet was detected on the FloatingIP so setting the Region based on the Droplet")
123123
log.Printf("[INFO] The region of the Droplet is %s", floatingIp.Droplet.Region.Slug)
124124
d.Set("region", floatingIp.Droplet.Region.Slug)
125+
d.Set("droplet_id", floatingIp.Droplet.ID)
126+
125127
} else {
126128
d.Set("region", floatingIp.Region.Slug)
127129
}

0 commit comments

Comments
 (0)