Skip to content

Commit

Permalink
Fix update function for DB users (#341)
Browse files Browse the repository at this point in the history
The update function needs to use an escaped version as DB users can have slashes in their names.
  • Loading branch information
EricZaporzan committed Oct 28, 2020
1 parent c3f086b commit 50954f0
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion mongodbatlas/resource_mongodbatlas_database_user.go
Expand Up @@ -268,7 +268,7 @@ func resourceMongoDBAtlasDatabaseUserUpdate(d *schema.ResourceData, meta interfa
dbUser.Scopes = expandScopes(d)
}

_, _, err = conn.DatabaseUsers.Update(context.Background(), projectID, username, dbUser)
_, _, err = conn.DatabaseUsers.Update(context.Background(), projectID, usernameEscaped, dbUser)
if err != nil {
return fmt.Errorf("error updating database user(%s): %s", username, err)
}
Expand Down

0 comments on commit 50954f0

Please sign in to comment.