In This article i will show you how to provision database users and roles using terraform with mongodb provider from terraform.

Did you come across a need to provision a database user or a database role with Terraform and you couldn’t find a solution ?
I did and i found myself using a Mongo client with a null_resource from Terraform and the was sad:(

Hopefully there’s another solution.

So i create a Terraform provider that can help us :D

Thanks to Kaginari’s mongodb provider now we can provision database users and role using Terraform

https://registry.terraform.io/providers/Kaginari/mongodb/latest/docs

1- Configuring the provider :

Bouajina Montassar

Devops Consultant

Get the Medium app

A button that says 'Download on the App Store', and if clicked it will lead you to the iOS App store
A button that says 'Get it on, Google Play', and if clicked it will lead you to the Google Play store