providers/aws: ebs volume and autoscaling group
This commit is contained in:
parent
884980da1a
commit
9cdbed11ff
|
@ -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"},
|
||||||
|
},
|
||||||
|
},
|
||||||
|
})
|
||||||
|
}
|
|
@ -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,
|
||||||
|
},
|
||||||
|
},
|
||||||
|
})
|
||||||
|
}
|
|
@ -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{
|
||||||
|
|
|
@ -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{
|
||||||
|
|
Loading…
Reference in New Issue