provider/openstack: Support Import openstack_compute_servergroup_v2 (#7349)
This commit is contained in:
parent
c1e4d297f3
commit
0466520626
|
@ -0,0 +1,29 @@
|
||||||
|
package openstack
|
||||||
|
|
||||||
|
import (
|
||||||
|
"testing"
|
||||||
|
|
||||||
|
"github.com/hashicorp/terraform/helper/resource"
|
||||||
|
)
|
||||||
|
|
||||||
|
func TestAccComputeV2ServerGroup_importBasic(t *testing.T) {
|
||||||
|
resourceName := "openstack_compute_servergroup_v2.mysg"
|
||||||
|
|
||||||
|
resource.Test(t, resource.TestCase{
|
||||||
|
PreCheck: func() { testAccPreCheck(t) },
|
||||||
|
Providers: testAccProviders,
|
||||||
|
CheckDestroy: testAccCheckComputeV2ServerGroupDestroy,
|
||||||
|
Steps: []resource.TestStep{
|
||||||
|
resource.TestStep{
|
||||||
|
Config: testAccComputeV2ServerGroup_basic,
|
||||||
|
},
|
||||||
|
|
||||||
|
resource.TestStep{
|
||||||
|
ResourceName: resourceName,
|
||||||
|
ImportState: true,
|
||||||
|
ImportStateVerify: true,
|
||||||
|
ImportStateVerifyIgnore: []string{"region"},
|
||||||
|
},
|
||||||
|
},
|
||||||
|
})
|
||||||
|
}
|
|
@ -14,6 +14,9 @@ func resourceComputeServerGroupV2() *schema.Resource {
|
||||||
Read: resourceComputeServerGroupV2Read,
|
Read: resourceComputeServerGroupV2Read,
|
||||||
Update: nil,
|
Update: nil,
|
||||||
Delete: resourceComputeServerGroupV2Delete,
|
Delete: resourceComputeServerGroupV2Delete,
|
||||||
|
Importer: &schema.ResourceImporter{
|
||||||
|
State: schema.ImportStatePassthrough,
|
||||||
|
},
|
||||||
|
|
||||||
Schema: map[string]*schema.Schema{
|
Schema: map[string]*schema.Schema{
|
||||||
"region": &schema.Schema{
|
"region": &schema.Schema{
|
||||||
|
|
Loading…
Reference in New Issue