diff --git a/builtin/providers/google/import_google_project_test.go b/builtin/providers/google/import_google_project_test.go new file mode 100644 index 000000000..b35c8d6bc --- /dev/null +++ b/builtin/providers/google/import_google_project_test.go @@ -0,0 +1,29 @@ +package google + +import ( + "fmt" + "testing" + + "github.com/hashicorp/terraform/helper/resource" +) + +func TestAccGoogleProject_importBasic(t *testing.T) { + resourceName := "google_project.acceptance" + conf := fmt.Sprintf(testAccGoogleProject_basic, projectId) + + resource.Test(t, resource.TestCase{ + PreCheck: func() { testAccPreCheck(t) }, + Providers: testAccProviders, + Steps: []resource.TestStep{ + resource.TestStep{ + Config: conf, + }, + + resource.TestStep{ + ResourceName: resourceName, + ImportState: true, + ImportStateVerify: true, + }, + }, + }) +} diff --git a/builtin/providers/google/resource_google_project.go b/builtin/providers/google/resource_google_project.go index b46d66145..9e845ed33 100644 --- a/builtin/providers/google/resource_google_project.go +++ b/builtin/providers/google/resource_google_project.go @@ -29,6 +29,9 @@ func resourceGoogleProject() *schema.Resource { Read: resourceGoogleProjectRead, Update: resourceGoogleProjectUpdate, Delete: resourceGoogleProjectDelete, + Importer: &schema.ResourceImporter{ + State: schema.ImportStatePassthrough, + }, Schema: map[string]*schema.Schema{ "id": &schema.Schema{ diff --git a/website/source/docs/import/importability.html.md b/website/source/docs/import/importability.html.md index b3c56461d..a3b305738 100644 --- a/website/source/docs/import/importability.html.md +++ b/website/source/docs/import/importability.html.md @@ -135,6 +135,7 @@ To make a resource importable, please see the * google_compute_instance_group_manager * google_compute_instance_template * google_compute_target_pool +* google_project ### OpenStack