Ensuring the Redis instance exists. Fixes #13896
This commit is contained in:
parent
105167c6cb
commit
8e58be37c7
|
@ -281,14 +281,15 @@ 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)
|
||||
}
|
||||
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