2018-09-24 20:54:33 +00:00
|
|
|
// ----------------------------------------------------------------------------
|
|
|
|
//
|
|
|
|
// *** AUTO GENERATED CODE *** AUTO GENERATED CODE ***
|
|
|
|
//
|
|
|
|
// ----------------------------------------------------------------------------
|
|
|
|
//
|
|
|
|
// This file is automatically generated by Magic Modules and manual
|
|
|
|
// changes will be clobbered when the file is regenerated.
|
|
|
|
//
|
|
|
|
// Please read more about how to change this file in
|
|
|
|
// .github/CONTRIBUTING.md.
|
|
|
|
//
|
|
|
|
// ----------------------------------------------------------------------------
|
|
|
|
|
|
|
|
package google
|
|
|
|
|
|
|
|
import (
|
|
|
|
"fmt"
|
|
|
|
"testing"
|
|
|
|
|
|
|
|
"github.com/hashicorp/terraform/helper/acctest"
|
|
|
|
"github.com/hashicorp/terraform/helper/resource"
|
|
|
|
)
|
|
|
|
|
2018-10-24 19:06:09 +00:00
|
|
|
func TestAccComputeDisk_DiskBasicExample(t *testing.T) {
|
2018-09-24 20:54:33 +00:00
|
|
|
t.Parallel()
|
|
|
|
|
|
|
|
resource.Test(t, resource.TestCase{
|
|
|
|
PreCheck: func() { testAccPreCheck(t) },
|
|
|
|
Providers: testAccProviders,
|
|
|
|
CheckDestroy: testAccCheckComputeDiskDestroy,
|
|
|
|
Steps: []resource.TestStep{
|
|
|
|
{
|
2018-10-24 19:06:09 +00:00
|
|
|
Config: testAccComputeDisk_DiskBasicExample(acctest.RandString(10)),
|
2018-09-24 20:54:33 +00:00
|
|
|
},
|
|
|
|
{
|
|
|
|
ResourceName: "google_compute_disk.default",
|
|
|
|
ImportState: true,
|
|
|
|
ImportStateVerify: true,
|
|
|
|
},
|
|
|
|
},
|
|
|
|
})
|
|
|
|
}
|
|
|
|
|
2018-10-24 19:06:09 +00:00
|
|
|
func testAccComputeDisk_DiskBasicExample(val string) string {
|
2018-09-24 20:54:33 +00:00
|
|
|
return fmt.Sprintf(`
|
|
|
|
resource "google_compute_disk" "default" {
|
|
|
|
name = "test-disk-%s"
|
|
|
|
type = "pd-ssd"
|
|
|
|
zone = "us-central1-a"
|
|
|
|
image = "debian-8-jessie-v20170523"
|
|
|
|
labels {
|
|
|
|
environment = "dev"
|
|
|
|
}
|
|
|
|
}
|
|
|
|
`, val,
|
|
|
|
)
|
|
|
|
}
|