Unable to create to new AlloyDB database using Terraform

156 views Asked by At

I have created a new AlloyDB cluster and instance on GCP AlloyDB using erraform. As per the docs, the default database name is postgres and I am able to connect successfully to it using psql command.

Now, I need to create a new database with a different name using terraform. However, I am not able to find any documentation on what resource type can be used for doing so. I tried using google_sql_database but it did not work. Am I missing something here?

1

There are 1 answers

0
Gabe Weiss On BEST ANSWER

The current Terraform provider as of the writing of this response doesn't have support for database creation. The underlying APIs for AlloyDB also do not support this at this time, so you could write a custom piece of Terraform to run a script that's done directly with psql perhaps, but the TF provider won't enable doing that.