gcp cloudsql terraform - ghdrako/doc_snipets GitHub Wiki

To create a PostgreSQL instance using TF, you need the following resources:

The database_version field is already there, but currently updating it will force a destroy and create in terraform. I have added the logic to handle the database_version updates in the resource update function, so that it never forces a new resource when updated.

This operation is atomic and can not be performed with any other update/patch. i.e database_version field can not be updated alongside settings field. Update() does not support database_version and Patch() does not support patching any other field in the same request as database_version. For every other field apart for database_version we are using the Update(). I think the code works well in this case, we patch database_version then update the rest of the fields.

Manage database resources