feat(fast/data-mongodb): add MongoDB Atlas database user resource#4058
feat(fast/data-mongodb): add MongoDB Atlas database user resource#4058suresharam wants to merge 1 commit into
Conversation
|
Thanks for your pull request! It looks like this may be your first contribution to a Google open source project. Before we can look at your pull request, you'll need to sign a Contributor License Agreement (CLA). View this failed invocation of the CLA check for more information. For the most up to date status, view the checks section at the bottom of the pull request. |
Automated PR Review 🤖(Reviewed commit: 2eb0904) Thank you for your pull request! Here is a review of the changes against the Cloud Foundation Fabric guidelines. PR TitleThe PR title currently uses the Conventional Commits format ( Variable Design & NamingIn Opinionated Resource ConfigurationIn To make this flexible while keeping the common case simple, please expose these as optional attributes in the Suggested variable "database_user" {
description = "MongoDB Atlas database user configuration."
type = object({
name = string
password = string
auth_database_name = optional(string, "admin")
roles = optional(list(object({
role_name = string
database_name = string
})), [{
role_name = "readAnyDatabase"
database_name = "admin"
}])
})
}Suggested resource "mongodbatlas_database_user" "database_user" {
username = var.database_user.name
password = var.database_user.password
project_id = mongodbatlas_project.default.id
auth_database_name = var.database_user.auth_database_name
dynamic "roles" {
for_each = var.database_user.roles
content {
role_name = roles.value.role_name
database_name = roles.value.database_name
}
}
}DocumentationIf you apply the variable changes above, please remember to:
Once these updates are made, a maintainer will perform the final review and approval. |
Add MongoDB Atlas database user support to the
data-mongodbproject template.A new
mongodbatlas_database_userresource is provisioned as part of the template, configured via a new requireddatabase_uservariable. The user is created with thereadAnyDatabaserole scoped to theadmindatabase.Checklist
I applicable, I acknowledge that I have:
terraform fmton all modified filestools/tfdoc.py