Merge pull request #10469 from hashicorp/paddy_10425_import_projects
providers/google: make projects importable.
This commit is contained in:
commit
ce89d6ca9d
|
@ -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,
|
||||
},
|
||||
},
|
||||
})
|
||||
}
|
|
@ -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{
|
||||
|
|
|
@ -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
|
||||
|
||||
|
|
Loading…
Reference in New Issue