Skip to Main Content

MongoByte MongoDB Logo

Welcome to the new MongoDB Feedback Portal!

{Improvement: "Your idea"}
We’ve upgraded our system to better capture and act on your feedback.
Your feedback is meaningful and helps us build better products.

Status Submitted
Categories Atlas
Created by Guest
Created on Dec 18, 2024

Update the regex used to split a database user import id to match the database name constraint

Hello, While doing terraform import of the mongo db users, i'm facing an issue with the mongo terraform provider. The database name contains an underscore so my imported user ID is 5ceClusterId-username-my_database. I've got the following error when i launch my terraform import: Error: error splitting database User info from ID │ import format error: to import a Database User, use the format {project_id}-{username}-{auth_database_name} Indeed the mongo tf provider uses a regex to split this ID and doesn't allow characters for db name others than $a-z. => https://github.com/mongodb/terraform-provider-mongodbatlas/blob/ebb67f86165e0a364e486e769678377db507f005/internal/service/databaseuser/resource_database_user.go#L349 Is it possible to update the regex to allow others characters like my underscore in this case, and maybe match only the constraints that are set on database's name creation ? Thanks Best regards
  • Attach files