Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Support setting 'location' in google_sql_database_instance backup_configuration #1282

Merged
merged 1 commit into from
Oct 21, 2019
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 6 additions & 0 deletions google-beta/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-beta/resource_sql_database_instance_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -903,7 +903,8 @@ resource "google_sql_database_instance" "instance" {
availability_type = "REGIONAL"

backup_configuration {
enabled = true
enabled = true
location = "us"
}
}
}
Expand Down