Merge pull request #13899 from hashicorp/azurerm-redis-bug
provider/azurerm: fixing a bug refreshing the `azurerm_redis_cache`
This commit is contained in:
commit
a7401ad354
|
@ -281,14 +281,17 @@ func resourceArmRedisCacheRead(d *schema.ResourceData, meta interface{}) error {
|
|||
name := id.Path["Redis"]
|
||||
|
||||
resp, err := client.Get(resGroup, name)
|
||||
if err != nil {
|
||||
return fmt.Errorf("Error making Read request on Azure Redis Cache %s: %s", name, err)
|
||||
}
|
||||
|
||||
// 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
|
||||
}
|
||||
|
||||
if err != nil {
|
||||
return fmt.Errorf("Error making Read request on Azure Redis Cache %s: %s", name, err)
|
||||
}
|
||||
|
||||
keysResp, err := client.ListKeys(resGroup, name)
|
||||
if err != nil {
|
||||
return fmt.Errorf("Error making ListKeys request on Azure Redis Cache %s: %s", name, err)
|
||||
|
|
Loading…
Reference in New Issue