mirror of
https://github.com/letic/terraform-provider-google.git
synced 2024-07-09 03:28:29 +00:00
Adding import for the compute_route resource
This commit is contained in:
parent
d03f802be2
commit
f66cd36c96
45
import_compute_route_test.go
Normal file
45
import_compute_route_test.go
Normal file
|
@ -0,0 +1,45 @@
|
|||
package google
|
||||
|
||||
import (
|
||||
"testing"
|
||||
|
||||
"github.com/hashicorp/terraform/helper/resource"
|
||||
)
|
||||
|
||||
func TestAccComputeRoute_importBasic(t *testing.T) {
|
||||
resourceName := "google_compute_network.foobar"
|
||||
|
||||
resource.Test(t, resource.TestCase{
|
||||
PreCheck: func() { testAccPreCheck(t) },
|
||||
Providers: testAccProviders,
|
||||
CheckDestroy: testAccCheckComputeNetworkDestroy,
|
||||
Steps: []resource.TestStep{
|
||||
{
|
||||
Config: testAccComputeRoute_basic,
|
||||
}, {
|
||||
ResourceName: resourceName,
|
||||
ImportState: true,
|
||||
ImportStateVerify: true,
|
||||
},
|
||||
},
|
||||
})
|
||||
}
|
||||
|
||||
func TestAccComputeRoute_importDefaultInternetGateway(t *testing.T) {
|
||||
resourceName := "google_compute_network.foobar"
|
||||
|
||||
resource.Test(t, resource.TestCase{
|
||||
PreCheck: func() { testAccPreCheck(t) },
|
||||
Providers: testAccProviders,
|
||||
CheckDestroy: testAccCheckComputeNetworkDestroy,
|
||||
Steps: []resource.TestStep{
|
||||
{
|
||||
Config: testAccComputeRoute_defaultInternetGateway,
|
||||
}, {
|
||||
ResourceName: resourceName,
|
||||
ImportState: true,
|
||||
ImportStateVerify: true,
|
||||
},
|
||||
},
|
||||
})
|
||||
}
|
|
@ -14,6 +14,9 @@ func resourceComputeRoute() *schema.Resource {
|
|||
Create: resourceComputeRouteCreate,
|
||||
Read: resourceComputeRouteRead,
|
||||
Delete: resourceComputeRouteDelete,
|
||||
Importer: &schema.ResourceImporter{
|
||||
State: schema.ImportStatePassthrough,
|
||||
},
|
||||
|
||||
Schema: map[string]*schema.Schema{
|
||||
"dest_range": &schema.Schema{
|
||||
|
|
Loading…
Reference in New Issue
Block a user