Terraform-provider-digitalocean: Add digitalocean_database and digitalocean_user support on digitalocean_database_cluster resource

Created on 25 Apr 2019  路  8Comments  路  Source: digitalocean/terraform-provider-digitalocean

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

new-resource good first issue hacktoberfest

Most helpful comment

Done, please have a look at my PRs:

327: digitalocean_database

328: digitalocean_database_user

All 8 comments

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:

327: digitalocean_database

328: digitalocean_database_user

Closed 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.

Was this page helpful?
0 / 5 - 0 ratings

Related issues

liztio picture liztio  路  4Comments

liarco picture liarco  路  6Comments

aetheon picture aetheon  路  6Comments

matt40k picture matt40k  路  5Comments

aboeglin picture aboeglin  路  5Comments