mirror of
https://github.com/letic/terraform-provider-google.git
synced 2024-10-06 18:51:13 +00:00
c1ddeac868
* Support importing google_sql_user * Updated documentation to reflect that passwords are not retrieved. * Added additional documentation detailing use. * Removed unneeded d.setId() line from GoogleSqlUser Read method. * Changed an errors.New() call to fmt.Errorf(). * Migrate schemas of existing GoogleSqlUser resources. * Remove explicitly setting 'id' property * Added google_sql_user to importability page. * Changed separator to '/' from '.' and updated tests + debug messages.
33 lines
780 B
Go
33 lines
780 B
Go
package google
|
|
|
|
import (
|
|
"testing"
|
|
|
|
"github.com/hashicorp/terraform/helper/acctest"
|
|
"github.com/hashicorp/terraform/helper/resource"
|
|
)
|
|
|
|
func TestAccGoogleSqlUser_importBasic(t *testing.T) {
|
|
resourceName := "google_sql_user.user"
|
|
user := acctest.RandString(10)
|
|
instance := acctest.RandString(10)
|
|
|
|
resource.Test(t, resource.TestCase{
|
|
PreCheck: func() { testAccPreCheck(t) },
|
|
Providers: testAccProviders,
|
|
CheckDestroy: testAccGoogleSqlUserDestroy,
|
|
Steps: []resource.TestStep{
|
|
resource.TestStep{
|
|
Config: testGoogleSqlUser_basic(instance, user),
|
|
},
|
|
|
|
resource.TestStep{
|
|
ResourceName: resourceName,
|
|
ImportState: true,
|
|
ImportStateVerify: true,
|
|
ImportStateVerifyIgnore: []string{"password"},
|
|
},
|
|
},
|
|
})
|
|
}
|