mirror of
https://github.com/letic/terraform-provider-google.git
synced 2024-09-07 09:36:44 +00:00
![Mike Fowler](/assets/img/avatar_default.png)
* Add ability to import `google_sql_database` * Update from code review * Ensure split id length and report error otherwise
32 lines
729 B
Go
32 lines
729 B
Go
package google
|
|
|
|
import (
|
|
"fmt"
|
|
"testing"
|
|
|
|
"github.com/hashicorp/terraform/helper/acctest"
|
|
"github.com/hashicorp/terraform/helper/resource"
|
|
)
|
|
|
|
func TestAccGoogleSqlDatabase_importBasic(t *testing.T) {
|
|
resourceName := "google_sql_database.database"
|
|
|
|
resource.Test(t, resource.TestCase{
|
|
PreCheck: func() { testAccPreCheck(t) },
|
|
Providers: testAccProviders,
|
|
CheckDestroy: testAccGoogleSqlDatabaseInstanceDestroy,
|
|
Steps: []resource.TestStep{
|
|
resource.TestStep{
|
|
Config: fmt.Sprintf(
|
|
testGoogleSqlDatabase_basic, acctest.RandString(10), acctest.RandString(10)),
|
|
},
|
|
|
|
resource.TestStep{
|
|
ResourceName: resourceName,
|
|
ImportState: true,
|
|
ImportStateVerify: true,
|
|
},
|
|
},
|
|
})
|
|
}
|