diff --git a/builtin/providers/aws/import_aws_elb_test.go b/builtin/providers/aws/import_aws_elb_test.go new file mode 100644 index 000000000..8a9f2a27c --- /dev/null +++ b/builtin/providers/aws/import_aws_elb_test.go @@ -0,0 +1,28 @@ +package aws + +import ( + "testing" + + "github.com/hashicorp/terraform/helper/resource" +) + +func TestAccAWSELB_importBasic(t *testing.T) { + resourceName := "aws_subnet.bar" + + resource.Test(t, resource.TestCase{ + PreCheck: func() { testAccPreCheck(t) }, + Providers: testAccProviders, + CheckDestroy: testAccCheckAWSELBDestroy, + Steps: []resource.TestStep{ + resource.TestStep{ + Config: testAccAWSELBConfig, + }, + + resource.TestStep{ + ResourceName: resourceName, + ImportState: true, + ImportStateVerify: true, + }, + }, + }) +} diff --git a/builtin/providers/aws/resource_aws_elb.go b/builtin/providers/aws/resource_aws_elb.go index 0042f5c06..332d112fe 100644 --- a/builtin/providers/aws/resource_aws_elb.go +++ b/builtin/providers/aws/resource_aws_elb.go @@ -22,6 +22,9 @@ func resourceAwsElb() *schema.Resource { Read: resourceAwsElbRead, Update: resourceAwsElbUpdate, Delete: resourceAwsElbDelete, + Importer: &schema.ResourceImporter{ + State: schema.ImportStatePassthrough, + }, Schema: map[string]*schema.Schema{ "name": &schema.Schema{