Skip to content

Commit

Permalink
- Add the instances delete function
Browse files Browse the repository at this point in the history
Signed-off-by: Alejandro JNM <alejandrojnm@gmail.com>
  • Loading branch information
alejandrojnm committed Jan 17, 2020
1 parent db611b6 commit 14822c9
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions provider/resource_instance.go
Original file line number Diff line number Diff line change
Expand Up @@ -215,5 +215,11 @@ func resourceInstanceUpdate(d *schema.ResourceData, m interface{}) error {
}

func resourceInstanceDelete(d *schema.ResourceData, m interface{}) error {
apiClient := m.(*civogo.Client)

_, err := apiClient.DeleteInstance(d.Id())
if err != nil {
log.Printf("[INFO] Civo instance (%s) was delete", d.Id())
}
return nil
}

0 comments on commit 14822c9

Please sign in to comment.