Closed bulowaty closed 2 years ago
resource "mongodbatlas_database_user" "protagonist" {
username = "protagonistUser"
password = "SomeRandomPasswordHere1"
project_id = mongodbatlas_project.mongo-project.id
auth_database_name = "admin"
roles {
role_name = "creatorRole"
database_name = "admin" #all the things related with user should be declared in 'admin' database
}
}
This one solved my issue. I think that it's worth to add it to documentation as example :)
Hello, first of all I would like to let you know that I checked the issue history (opened or not) and there were no answer for this problem. Delaying the process of user creation is not solving that problem so I think it needs to be reviewed deeper. I hope that this issue can be resolved with your help and if you need something else info do not hesitate to ask :)
Additionally if this feature would start to work, can I ask for add an example for mongodbatlas_database_user with custom role assignation? Thanks in advance for your time.
Terraform CLI and Terraform MongoDB Atlas Provider Version
Terraform Configuration File
Expected Behavior
The user should be created with assigned custom role.
Actual Behavior
The custom database roles have been created correctly but there is no possibility to use them
Additional Context
References
https://github.com/mongodb/terraform-provider-mongodbatlas/issues/273 https://github.com/mongodb/terraform-provider-mongodbatlas/issues/728