Comment explaning why we can have deleted resources in the state

This commit is contained in:
tombuildsstuff 2017-04-24 15:35:27 +01:00
parent 8e58be37c7
commit 04bf00f0c6
1 changed files with 2 additions and 0 deletions

View File

@ -281,6 +281,8 @@ func resourceArmRedisCacheRead(d *schema.ResourceData, meta interface{}) error {
name := id.Path["Redis"]
resp, err := client.Get(resGroup, name)
// covers if the resource has been deleted outside of TF, but is still in the state
if resp.StatusCode == http.StatusNotFound {
d.SetId("")
return nil