diff --git a/builtin/providers/digitalocean/resource_digitalocean_droplet.go b/builtin/providers/digitalocean/resource_digitalocean_droplet.go index f801eed67..88c0c6d07 100644 --- a/builtin/providers/digitalocean/resource_digitalocean_droplet.go +++ b/builtin/providers/digitalocean/resource_digitalocean_droplet.go @@ -165,6 +165,12 @@ func resourceDigitalOceanDropletRead(d *schema.ResourceData, meta interface{}) e // Retrieve the droplet properties for updating the state droplet, err := client.RetrieveDroplet(d.Id()) if err != nil { + // check if the droplet no longer exists. + if err.Error() == "Error retrieving droplet: API Error: 404 Not Found" { + d.SetId("") + return nil + } + return fmt.Errorf("Error retrieving droplet: %s", err) }