diff --git a/builtin/providers/aws/import_aws_network_interface_test.go b/builtin/providers/aws/import_aws_network_interface_test.go new file mode 100644 index 000000000..08f22c16f --- /dev/null +++ b/builtin/providers/aws/import_aws_network_interface_test.go @@ -0,0 +1,28 @@ +package aws + +import ( + "testing" + + "github.com/hashicorp/terraform/helper/resource" +) + +func TestAccAWSENI_importBasic(t *testing.T) { + resourceName := "aws_network_interface.bar" + + resource.Test(t, resource.TestCase{ + PreCheck: func() { testAccPreCheck(t) }, + Providers: testAccProviders, + CheckDestroy: testAccCheckAWSENIDestroy, + Steps: []resource.TestStep{ + resource.TestStep{ + Config: testAccAWSENIConfig, + }, + + resource.TestStep{ + ResourceName: resourceName, + ImportState: true, + ImportStateVerify: true, + }, + }, + }) +} diff --git a/builtin/providers/aws/resource_aws_network_interface.go b/builtin/providers/aws/resource_aws_network_interface.go index 7e139ea52..ccfdbfc8e 100644 --- a/builtin/providers/aws/resource_aws_network_interface.go +++ b/builtin/providers/aws/resource_aws_network_interface.go @@ -21,6 +21,9 @@ func resourceAwsNetworkInterface() *schema.Resource { Read: resourceAwsNetworkInterfaceRead, Update: resourceAwsNetworkInterfaceUpdate, Delete: resourceAwsNetworkInterfaceDelete, + Importer: &schema.ResourceImporter{ + State: schema.ImportStatePassthrough, + }, Schema: map[string]*schema.Schema{