hashicorp / terraform-provider-google

Terraform Provider for Google Cloud Platform
https://registry.terraform.io/providers/hashicorp/google/latest/docs
Mozilla Public License 2.0
2.36k stars 1.75k forks source link

Implement new cloud SQL API switchover #18807

Open lychgoogle opened 4 months ago

lychgoogle commented 4 months ago

Community Note

Description

We have new API switchover on cloud SQL (API doc) https://cloud.google.com/sql/docs/mysql/admin-api/rest/v1/instances/switchover , and we want to support them in terraform.

New or Affected Resource(s)

Potential Terraform Configuration

Suppose we have "original-primary" and "original-replica", then we make following change to the replica to trigger switchover.

resource "google_sql_database_instance" "original-replica" {
  provider = google-beta
  name = "original-replica"
  project = "my-project"
-  instance_type = "READ_REPLICA_INSTANCE"
+  instance_type = "CLOUD_SQL_INSTANCE" 
+  replica_names = ["original-primary"]
# irrelevant fields are omitted.
}

References

No response

b/359238666

lychgoogle commented 4 months ago

Addition on assignee: I'd like to work it myself, but not sure how to make me as an assignee.