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

Configuring non-regional failover

Open mans0954 opened this issue 3 years ago • 2 comments

TL;DR

Using other means (e.g. Google Cloud Deployment Manager) it's possible to configure failover for the zonal availability type. E.g.

gcloud --project **** sql instances describe ******
backendType: SECOND_GEN
...
failoverReplica:
  available: true
  name: ******
...
settings:
  activationPolicy: ALWAYS
  availabilityType: ZONAL
  backupConfiguration:
    backupRetentionSettings:
      retainedBackups: 7
      retentionUnit: COUNT
    binaryLogEnabled: true
    enabled: true
    kind: sql#backupConfiguration
    startTime: 02:00
    transactionLogRetentionDays: 7

If it's possible to configure this using terraform-google-sql-db then I can't figure it out from the documentation or the code.

Terraform Resources

See failover_target in https://registry.terraform.io/providers/hashicorp/google/latest/docs/resources/sql_database_instance

Detailed design

No response

Additional information

No response

mans0954 avatar Dec 13 '21 16:12 mans0954

This isn't currently supported in this module. We'd be happy to review a PR adding it.

morgante avatar Dec 13 '21 18:12 morgante

@mans0954 have you tried this parameter using resource directly? I am not sure if you can set this parameter for cloudSql anymore. Is this a parameter for legacy HA. I tried setting it up in resource directly and received following error.

googleapi: Error 400: The incoming request contained invalid data., invalidRequest

imrannayer avatar Mar 16 '22 17:03 imrannayer