mirror of
https://github.com/letic/terraform-provider-google.git
synced 2024-09-06 17:16:44 +00:00
![Vincent Roseberry](/assets/img/avatar_default.png)
* Add import support for google_compute_image. * Added comment explaning why we set the create_timeout in the import state method * Don't ForceNew for create_timeout field * Update image name in import documentation
45 lines
1.1 KiB
Go
45 lines
1.1 KiB
Go
package google
|
|
|
|
import (
|
|
"testing"
|
|
|
|
"github.com/hashicorp/terraform/helper/resource"
|
|
)
|
|
|
|
func TestAccComputeImage_importFromRawDisk(t *testing.T) {
|
|
resource.Test(t, resource.TestCase{
|
|
PreCheck: func() { testAccPreCheck(t) },
|
|
Providers: testAccProviders,
|
|
CheckDestroy: testAccCheckComputeImageDestroy,
|
|
Steps: []resource.TestStep{
|
|
resource.TestStep{
|
|
Config: testAccComputeImage_basic,
|
|
},
|
|
resource.TestStep{
|
|
ResourceName: "google_compute_image.foobar",
|
|
ImportState: true,
|
|
ImportStateVerify: true,
|
|
ImportStateVerifyIgnore: []string{"raw_disk", "create_timeout"},
|
|
},
|
|
},
|
|
})
|
|
}
|
|
|
|
func TestAccComputeImage_importFromSourceDisk(t *testing.T) {
|
|
resource.Test(t, resource.TestCase{
|
|
PreCheck: func() { testAccPreCheck(t) },
|
|
Providers: testAccProviders,
|
|
CheckDestroy: testAccCheckComputeImageDestroy,
|
|
Steps: []resource.TestStep{
|
|
resource.TestStep{
|
|
Config: testAccComputeImage_basedondisk,
|
|
},
|
|
resource.TestStep{
|
|
ResourceName: "google_compute_image.foobar",
|
|
ImportState: true,
|
|
ImportStateVerify: true,
|
|
},
|
|
},
|
|
})
|
|
}
|