Provide an option to disable password auth for database users
Currently, it is not possible securely create a user in a terraform DevOps pipeline, since "Passwords may show up in Terraform related logs" according to the documentation. If the password was no longer required to create a user, we could avoid this issue by only using certificate authentication.
![](https://secure.gravatar.com/avatar/74ceb8eef47f4311b598221d50653644?size=40&default=https%3A%2F%2Fassets.uvcdn.com%2Fpkg%2Fadmin%2Ficons%2Fuser_70-6bcf9e08938533adb9bac95c3e487cb2a6d4a32f890ca6fdc82e3072e0ea0368.png)
-
AdminZuhair (Admin, MongoDB) commented
Hi Philipp we now have several mechanisms for creating Resource: mongodbatlas_database_user without having to input Password (which as you correctly mention will end up in Terraform State file and logs in clear text). These include creating database users via: x509 type, IAM type, LDAP auth type, and most recently OIDC auth type. Hope this helps
https://registry.terraform.io/providers/mongodb/mongodbatlas/latest/docs/resources/database_user
-
William commented
Agree. I think it should be possible to use a `random_password` resource or a fixed initial password secret, then change it out of band, and use a lifecycle policy to prevent changes after the resource changes. But it would be much cleaner if the provider could set an empty or random password on resource creation, so that the password could be managed out of band vs. having to define the resource with a password, then removing the password resource later.
Even in the case of using a secure backend for the password, it will end up being viewable in cleartext in the (unencrypted) state, so not ideal.