diff --git a/third_party/terraform/resources/resource_sql_database.go b/third_party/terraform/resources/resource_sql_database.go index ffaf48cc301b..68f39b1e2c4c 100644 --- a/third_party/terraform/resources/resource_sql_database.go +++ b/third_party/terraform/resources/resource_sql_database.go @@ -7,7 +7,7 @@ import ( "github.com/hashicorp/terraform/helper/schema" - "google.golang.org/api/sqladmin/v1beta4" + sqladmin "google.golang.org/api/sqladmin/v1beta4" ) func resourceSqlDatabase() *schema.Resource { @@ -206,10 +206,10 @@ func resourceSqlDatabaseDelete(d *schema.ResourceData, meta interface{}) error { defer mutexKV.Unlock(instanceMutexKey(project, instance_name)) var op *sqladmin.Operation - err = retryTime(func() error { + err = retryTimeDuration(func() error { op, err = config.clientSqlAdmin.Databases.Delete(project, instance_name, database_name).Do() return err - }, 5 /* minutes */) + }, d.Timeout(schema.TimeoutDelete)) if err != nil { return fmt.Errorf("Error, failed to delete"+ diff --git a/third_party/terraform/resources/resource_sql_database_instance.go.erb b/third_party/terraform/resources/resource_sql_database_instance.go.erb index d4775c403800..81689ed04b4e 100644 --- a/third_party/terraform/resources/resource_sql_database_instance.go.erb +++ b/third_party/terraform/resources/resource_sql_database_instance.go.erb @@ -784,10 +784,10 @@ func resourceSqlDatabaseInstanceDelete(d *schema.ResourceData, meta interface{}) } var op *sqladmin.Operation - err = retryTime(func() error { + err = retryTimeDuration(func() error { op, err = config.clientSqlAdmin.Instances.Delete(project, d.Get("name").(string)).Do() return err - }, 5) + }, d.Timeout(schema.TimeoutDelete)) if err != nil { return fmt.Errorf("Error, failed to delete instance %s: %s", d.Get("name").(string), err) diff --git a/third_party/terraform/resources/resource_sql_user.go b/third_party/terraform/resources/resource_sql_user.go index f01c257dc464..30089f517665 100644 --- a/third_party/terraform/resources/resource_sql_user.go +++ b/third_party/terraform/resources/resource_sql_user.go @@ -208,10 +208,10 @@ func resourceSqlUserDelete(d *schema.ResourceData, meta interface{}) error { defer mutexKV.Unlock(instanceMutexKey(project, instance)) var op *sqladmin.Operation - err = retryTime(func() error { + err = retryTimeDuration(func() error { op, err = config.clientSqlAdmin.Users.Delete(project, instance, host, name).Do() return err - }, 5 /* minutes */) + }, d.Timeout(schema.TimeoutDelete)) if err != nil { return fmt.Errorf("Error, failed to delete"+