mirror of
https://github.com/letic/terraform-provider-google.git
synced 2024-10-01 16:21:06 +00:00
Clear bigtable instance when gone, pass along error message.
This commit is contained in:
parent
ec2f933252
commit
28b35fa3dd
@ -8,6 +8,7 @@ import (
|
|||||||
|
|
||||||
"cloud.google.com/go/bigtable"
|
"cloud.google.com/go/bigtable"
|
||||||
"golang.org/x/net/context"
|
"golang.org/x/net/context"
|
||||||
|
"log"
|
||||||
)
|
)
|
||||||
|
|
||||||
func resourceBigtableInstance() *schema.Resource {
|
func resourceBigtableInstance() *schema.Resource {
|
||||||
@ -134,7 +135,9 @@ func resourceBigtableInstanceRead(d *schema.ResourceData, meta interface{}) erro
|
|||||||
|
|
||||||
instance, err := c.InstanceInfo(ctx, d.Id())
|
instance, err := c.InstanceInfo(ctx, d.Id())
|
||||||
if err != nil {
|
if err != nil {
|
||||||
return fmt.Errorf("Error retrieving instance. Could not find %s.", d.Id())
|
log.Printf("[WARN] Removing %s because it's gone", d.Id())
|
||||||
|
d.SetId("")
|
||||||
|
return fmt.Errorf("Error retrieving instance. Could not find %s. %s", d.Id(), err)
|
||||||
}
|
}
|
||||||
|
|
||||||
d.Set("name", instance.Name)
|
d.Set("name", instance.Name)
|
||||||
|
Loading…
Reference in New Issue
Block a user