Skip to content

Commit

Permalink
Support setting 'location' in google_sql_database_instance back… (#4681)
Browse files Browse the repository at this point in the history
  • Loading branch information
JamesGuthrie authored and danawillow committed Oct 21, 2019
1 parent 93c2c84 commit dd8f51b
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 1 deletion.
6 changes: 6 additions & 0 deletions google/resource_sql_database_instance.go
Original file line number Diff line number Diff line change
Expand Up @@ -118,6 +118,10 @@ func resourceSqlDatabaseInstance() *schema.Resource {
// start_time is randomly assigned if not set
Computed: true,
},
"location": {
Type: schema.TypeString,
Optional: true,
},
},
},
},
Expand Down Expand Up @@ -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),
}
}

Expand Down Expand Up @@ -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}
Expand Down
3 changes: 2 additions & 1 deletion google/resource_sql_database_instance_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -843,7 +843,8 @@ resource "google_sql_database_instance" "instance" {
availability_type = "REGIONAL"
backup_configuration {
enabled = true
enabled = true
location = "us"
}
}
}
Expand Down

0 comments on commit dd8f51b

Please sign in to comment.