Skip to content

Commit

Permalink
Implement resourceInstanceDelete
Browse files Browse the repository at this point in the history
  • Loading branch information
mwarkentin committed Dec 29, 2017
1 parent 234eab5 commit f4bdfe5
Showing 1 changed file with 9 additions and 4 deletions.
13 changes: 9 additions & 4 deletions resource_instance.go
Original file line number Diff line number Diff line change
Expand Up @@ -100,8 +100,13 @@ func resourceInstanceUpdate(d *schema.ResourceData, meta interface{}) error {
}

func resourceInstanceDelete(d *schema.ResourceData, meta interface{}) error {
// d.SetId("") is automatically called assuming delete returns no errors, but
// it is added here for explicitness.
d.SetId("")
return nil
client := meta.(*cloudamqp.Client)

id, err := strconv.Atoi(d.Id())
if err != nil {
return err
}

_, err = client.Instances.Delete(id)
return err
}

0 comments on commit f4bdfe5

Please sign in to comment.