Skip to content

Commit

Permalink
add delete to mongodbatlas_database_user resource
Browse files Browse the repository at this point in the history
  • Loading branch information
akshaykarle committed Jan 10, 2018
1 parent 65e5e59 commit 62eddd1
Showing 1 changed file with 8 additions and 0 deletions.
8 changes: 8 additions & 0 deletions mongodbatlas/database_user.go
Original file line number Diff line number Diff line change
Expand Up @@ -132,6 +132,14 @@ func resourceDatabaseUserUpdate(d *schema.ResourceData, meta interface{}) error
}

func resourceDatabaseUserDelete(d *schema.ResourceData, meta interface{}) error {
client := meta.(*mongodb.Client)

log.Printf("[DEBUG] MongoDB DatabaseUser destroy: %v", d.Id())
_, err := client.DatabaseUsers.Delete(d.Get("group").(string), d.Id())
if err != nil {
return fmt.Errorf("Error destroying MongoDB DatabaseUser %s: %s", d.Id(), err)
}

return nil
}

Expand Down

0 comments on commit 62eddd1

Please sign in to comment.