Create databases and collections via API thorough Terraform
Create databases (DB) and collections via API thorough Terraform after the cluster has been created in Atlas. This would provide the ease of writing and running it in a single script before any data is loaded.

5 comments
-
Anton commented
At the moment we generate a lot of new DB and collections for our clients. Right now we use TF for create user and set privileges but have no possibilities to create DB and fill collections necessary data. for these purposes we use some executing scripts. Meanwhile Microsoft provide this option. You can find more details here https://registry.terraform.io/providers/hashicorp/azurerm/latest/docs/resources/cosmosdb_mongo_collection
-
Hi Ravindra and other here, Currently the Atlas API focuses on administration functions and the authentication to that is via a programmatic key that does not have access to the data layer, since our Terraform provider covers this API it is providing functions inline with the capabilities of the API. However, it would be great to know more around use cases that are driving this request. If you'd like to share/discuss it would be great to talk. Feel free to reply here or reach out to me directly, melissa.plunkett@mongodb.com. -Melissa
-
Ravindra commented
Is there any updates on this one?
-
David commented
This would be great feature !
-
David commented
I would be great if the MongoDB Atlas provider would support the creation of databases. At the moment you still have to create custom scripts to provision databases inside a cluster.