diff --git a/builtin/providers/openstack/import_openstack_compute_floatingip_v2_test.go b/builtin/providers/openstack/import_openstack_compute_floatingip_v2_test.go new file mode 100644 index 000000000..12fef46d3 --- /dev/null +++ b/builtin/providers/openstack/import_openstack_compute_floatingip_v2_test.go @@ -0,0 +1,29 @@ +package openstack + +import ( + "testing" + + "github.com/hashicorp/terraform/helper/resource" +) + +func TestAccComputeV2FloatingIP_importBasic(t *testing.T) { + resourceName := "openstack_compute_floatingip_v2.foo" + + resource.Test(t, resource.TestCase{ + PreCheck: func() { testAccPreCheck(t) }, + Providers: testAccProviders, + CheckDestroy: testAccCheckComputeV2FloatingIPDestroy, + Steps: []resource.TestStep{ + resource.TestStep{ + Config: testAccComputeV2FloatingIP_basic, + }, + + resource.TestStep{ + ResourceName: resourceName, + ImportState: true, + ImportStateVerify: true, + ImportStateVerifyIgnore: []string{"region"}, + }, + }, + }) +} diff --git a/builtin/providers/openstack/resource_openstack_compute_floatingip_v2.go b/builtin/providers/openstack/resource_openstack_compute_floatingip_v2.go index 731b5f941..46f23ead6 100644 --- a/builtin/providers/openstack/resource_openstack_compute_floatingip_v2.go +++ b/builtin/providers/openstack/resource_openstack_compute_floatingip_v2.go @@ -14,6 +14,9 @@ func resourceComputeFloatingIPV2() *schema.Resource { Read: resourceComputeFloatingIPV2Read, Update: nil, Delete: resourceComputeFloatingIPV2Delete, + Importer: &schema.ResourceImporter{ + State: schema.ImportStatePassthrough, + }, Schema: map[string]*schema.Schema{ "region": &schema.Schema{