terraform-google-sql-db icon indicating copy to clipboard operation
terraform-google-sql-db copied to clipboard

Support for cascading replicas

Open twingate-blee opened this issue 1 year ago • 3 comments

TL;DR

Cloud SQL now supports cascading replicas (https://cloud.google.com/sql/docs/postgres/replication/#cascading-replicas) for postgres and mysql. With the current module we can only create a replica at one level.

Terraform Resources

google_sql_database_instance

Detailed design

We should be able to add up to four levels of replicas, including the primary instance.

My thought is that the existing variable read_replicas can be nested to contain multiple levels of replicas

In the resource

resource "google_sql_database_instance" "replicas" {

The variable master_instance_name will need to be dynamically set instead of always referencing the primary instance google_sql_database_instance.default.name

Additional information

No response

twingate-blee avatar Aug 22 '23 20:08 twingate-blee