New Resource(s)
digitalocean_database
digitalocean_user
Details
DigitalOcean released a new managed database service. It would be nice to manage that resouce, some work was already done by adding the new resource digitalocean_database_cluster, would be good if we could manage database creation and user configuration via Terraform.
This issue is related with https://github.com/terraform-providers/terraform-provider-digitalocean/issues/189
Is there a way to create databases and users with terraform provisionally?
I'm really interested in this feature.
@Yamilquery There is a PostgreSQL provider that will let you create databases and roles. (You'll quickly find yourself in the chicken-and-egg situation described in https://github.com/hashicorp/terraform/issues/2430 where your PostgreSQL provider will depend on a value from the database cluster resource, though.)
DO already have API's available for this:
https://developers.digitalocean.com/documentation/v2/#add-a-database-user
https://developers.digitalocean.com/documentation/v2/#add-a-new-database
@ehamberg I am fine using the Postgres but not sure if it is the best way to perform those actions and even if they will work, but at first glance it seems a good and workable approach since, this goes a bit more into the context of the actual application. I will give it a try and see if it works.
Let me try tackling this, seems simple.
Done, please have a look at my PRs:
digitalocean_databasedigitalocean_database_userClosed via #327 and #328
Just for future reference, in my case i ended in using the postgres provider since we can have control to do other stuff too.
Most helpful comment
Done, please have a look at my PRs:
327:
digitalocean_database328:
digitalocean_database_user