providers/aws: ebs volume and autoscaling group

This commit is contained in:
Mitchell Hashimoto 2016-05-13 11:39:08 -07:00
parent 884980da1a
commit 9cdbed11ff
No known key found for this signature in database
GPG Key ID: 744E147AA52F5B0A
4 changed files with 66 additions and 0 deletions

View File

@ -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"},
},
},
})
}

View File

@ -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,
},
},
})
}

View File

@ -21,6 +21,9 @@ func resourceAwsAutoscalingGroup() *schema.Resource {
Read: resourceAwsAutoscalingGroupRead, Read: resourceAwsAutoscalingGroupRead,
Update: resourceAwsAutoscalingGroupUpdate, Update: resourceAwsAutoscalingGroupUpdate,
Delete: resourceAwsAutoscalingGroupDelete, Delete: resourceAwsAutoscalingGroupDelete,
Importer: &schema.ResourceImporter{
State: schema.ImportStatePassthrough,
},
Schema: map[string]*schema.Schema{ Schema: map[string]*schema.Schema{
"name": &schema.Schema{ "name": &schema.Schema{

View File

@ -19,6 +19,9 @@ func resourceAwsEbsVolume() *schema.Resource {
Read: resourceAwsEbsVolumeRead, Read: resourceAwsEbsVolumeRead,
Update: resourceAWSEbsVolumeUpdate, Update: resourceAWSEbsVolumeUpdate,
Delete: resourceAwsEbsVolumeDelete, Delete: resourceAwsEbsVolumeDelete,
Importer: &schema.ResourceImporter{
State: schema.ImportStatePassthrough,
},
Schema: map[string]*schema.Schema{ Schema: map[string]*schema.Schema{
"availability_zone": &schema.Schema{ "availability_zone": &schema.Schema{