provider/openstack: Support Import openstack_compute_secgroup_v2 (#7350)
This commit is contained in:
parent
8d8becdfdb
commit
c1e4d297f3
|
@ -0,0 +1,29 @@
|
|||
package openstack
|
||||
|
||||
import (
|
||||
"testing"
|
||||
|
||||
"github.com/hashicorp/terraform/helper/resource"
|
||||
)
|
||||
|
||||
func TestAccComputeV2SecGroup_importBasic(t *testing.T) {
|
||||
resourceName := "openstack_compute_secgroup_v2.foo"
|
||||
|
||||
resource.Test(t, resource.TestCase{
|
||||
PreCheck: func() { testAccPreCheck(t) },
|
||||
Providers: testAccProviders,
|
||||
CheckDestroy: testAccCheckComputeV2SecGroupDestroy,
|
||||
Steps: []resource.TestStep{
|
||||
resource.TestStep{
|
||||
Config: testAccComputeV2SecGroup_basic_orig,
|
||||
},
|
||||
|
||||
resource.TestStep{
|
||||
ResourceName: resourceName,
|
||||
ImportState: true,
|
||||
ImportStateVerify: true,
|
||||
ImportStateVerifyIgnore: []string{"region"},
|
||||
},
|
||||
},
|
||||
})
|
||||
}
|
|
@ -20,6 +20,9 @@ func resourceComputeSecGroupV2() *schema.Resource {
|
|||
Read: resourceComputeSecGroupV2Read,
|
||||
Update: resourceComputeSecGroupV2Update,
|
||||
Delete: resourceComputeSecGroupV2Delete,
|
||||
Importer: &schema.ResourceImporter{
|
||||
State: schema.ImportStatePassthrough,
|
||||
},
|
||||
|
||||
Schema: map[string]*schema.Schema{
|
||||
"region": &schema.Schema{
|
||||
|
|
Loading…
Reference in New Issue