terraform-google-sql-db
terraform-google-sql-db copied to clipboard
Support for cascading replicas
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