diff --git a/builtin/providers/aws/import_aws_autoscaling_group_test.go b/builtin/providers/aws/import_aws_autoscaling_group_test.go new file mode 100644 index 000000000..920df152c --- /dev/null +++ b/builtin/providers/aws/import_aws_autoscaling_group_test.go @@ -0,0 +1,33 @@ +package aws + +import ( + "fmt" + "testing" + + "github.com/hashicorp/terraform/helper/acctest" + "github.com/hashicorp/terraform/helper/resource" +) + +func TestAccAWSAutoScalingGroup_importBasic(t *testing.T) { + resourceName := "aws_autoscaling_group.bar" + randName := fmt.Sprintf("terraform-test-%s", acctest.RandString(10)) + + resource.Test(t, resource.TestCase{ + PreCheck: func() { testAccPreCheck(t) }, + Providers: testAccProviders, + CheckDestroy: testAccCheckAWSAutoScalingGroupDestroy, + Steps: []resource.TestStep{ + resource.TestStep{ + Config: testAccAWSAutoScalingGroupConfig(randName), + }, + + resource.TestStep{ + ResourceName: resourceName, + ImportState: true, + ImportStateVerify: true, + ImportStateVerifyIgnore: []string{ + "force_delete", "metrics_granularity", "wait_for_capacity_timeout"}, + }, + }, + }) +} diff --git a/builtin/providers/aws/import_aws_ebs_volume_test.go b/builtin/providers/aws/import_aws_ebs_volume_test.go new file mode 100644 index 000000000..fd15bc241 --- /dev/null +++ b/builtin/providers/aws/import_aws_ebs_volume_test.go @@ -0,0 +1,27 @@ +package aws + +import ( + "testing" + + "github.com/hashicorp/terraform/helper/resource" +) + +func TestAccAWSEBSVolume_importBasic(t *testing.T) { + resourceName := "aws_ebs_volume.test" + + resource.Test(t, resource.TestCase{ + PreCheck: func() { testAccPreCheck(t) }, + Providers: testAccProviders, + Steps: []resource.TestStep{ + resource.TestStep{ + Config: testAccAwsEbsVolumeConfig, + }, + + resource.TestStep{ + ResourceName: resourceName, + ImportState: true, + ImportStateVerify: true, + }, + }, + }) +} diff --git a/builtin/providers/aws/resource_aws_autoscaling_group.go b/builtin/providers/aws/resource_aws_autoscaling_group.go index 795d59ea3..06036b248 100644 --- a/builtin/providers/aws/resource_aws_autoscaling_group.go +++ b/builtin/providers/aws/resource_aws_autoscaling_group.go @@ -21,6 +21,9 @@ func resourceAwsAutoscalingGroup() *schema.Resource { Read: resourceAwsAutoscalingGroupRead, Update: resourceAwsAutoscalingGroupUpdate, Delete: resourceAwsAutoscalingGroupDelete, + Importer: &schema.ResourceImporter{ + State: schema.ImportStatePassthrough, + }, Schema: map[string]*schema.Schema{ "name": &schema.Schema{ diff --git a/builtin/providers/aws/resource_aws_ebs_volume.go b/builtin/providers/aws/resource_aws_ebs_volume.go index 8dfbd0cf3..43914ef6b 100644 --- a/builtin/providers/aws/resource_aws_ebs_volume.go +++ b/builtin/providers/aws/resource_aws_ebs_volume.go @@ -19,6 +19,9 @@ func resourceAwsEbsVolume() *schema.Resource { Read: resourceAwsEbsVolumeRead, Update: resourceAWSEbsVolumeUpdate, Delete: resourceAwsEbsVolumeDelete, + Importer: &schema.ResourceImporter{ + State: schema.ImportStatePassthrough, + }, Schema: map[string]*schema.Schema{ "availability_zone": &schema.Schema{