Closed hund030 closed 5 years ago
Current:
if features.ShouldResourcesBeImported() && d.IsNewResource() { resp, err := client.Get(ctx, resourceGroup, name, "") if err != nil { if !utils.ResponseWasNotFound(resp.Response) { return fmt.Errorf("Error checking for present of existing Private Endpoint %q (Resource Group %q): %+v", name, resourceGroup, err) } } if !utils.ResponseWasNotFound(resp.Response) { return tf.ImportAsExistsError("azurerm_private_link_endpoint", *resp.ID) } }
Should be:
if features.ShouldResourcesBeImported() && d.IsNewResource() { existing, err := client.Get(ctx, resourceGroup, name, "") if err != nil { if !utils.ResponseWasNotFound(existing.Response) { return fmt.Errorf("Error checking for present of existing Private Endpoint %q (Resource Group %q): %+v", name, resourceGroup, err) } } if existing.ID != nil && *existing.ID != "" { return tf.ImportAsExistsError("azurerm_private_link_endpoint", *existing.ID) } }
Expected to be solved in #65
Current:
Should be: