From 62c6b870ed4bbe02d3a734c5d2c90ec6343145e2 Mon Sep 17 00:00:00 2001 From: James Guthrie Date: Tue, 15 Oct 2019 20:03:45 +0200 Subject: [PATCH] Support setting 'location' in google_sql_database_instance backup_configuration --- google/resource_sql_database_instance.go | 6 ++++++ google/resource_sql_database_instance_test.go | 3 ++- 2 files changed, 8 insertions(+), 1 deletion(-) diff --git a/google/resource_sql_database_instance.go b/google/resource_sql_database_instance.go index e05bcd2d61a..dbf55492eec 100644 --- a/google/resource_sql_database_instance.go +++ b/google/resource_sql_database_instance.go @@ -118,6 +118,10 @@ func resourceSqlDatabaseInstance() *schema.Resource { // start_time is randomly assigned if not set Computed: true, }, + "location": { + Type: schema.TypeString, + Optional: true, + }, }, }, }, @@ -690,6 +694,7 @@ func expandBackupConfiguration(configured []interface{}) *sqladmin.BackupConfigu BinaryLogEnabled: _backupConfiguration["binary_log_enabled"].(bool), Enabled: _backupConfiguration["enabled"].(bool), StartTime: _backupConfiguration["start_time"].(string), + Location: _backupConfiguration["location"].(string), } } @@ -898,6 +903,7 @@ func flattenBackupConfiguration(backupConfiguration *sqladmin.BackupConfiguratio "binary_log_enabled": backupConfiguration.BinaryLogEnabled, "enabled": backupConfiguration.Enabled, "start_time": backupConfiguration.StartTime, + "location": backupConfiguration.Location, } return []map[string]interface{}{data} diff --git a/google/resource_sql_database_instance_test.go b/google/resource_sql_database_instance_test.go index 5668e0739c2..78132442fb8 100644 --- a/google/resource_sql_database_instance_test.go +++ b/google/resource_sql_database_instance_test.go @@ -843,7 +843,8 @@ resource "google_sql_database_instance" "instance" { availability_type = "REGIONAL" backup_configuration { - enabled = true + enabled = true + location = "us" } } }