mirror of
https://github.com/opentofu/opentofu.git
synced 2025-01-08 15:13:56 -06:00
providers/aws: ebs volume and autoscaling group
This commit is contained in:
parent
884980da1a
commit
9cdbed11ff
33
builtin/providers/aws/import_aws_autoscaling_group_test.go
Normal file
33
builtin/providers/aws/import_aws_autoscaling_group_test.go
Normal 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"},
|
||||
},
|
||||
},
|
||||
})
|
||||
}
|
27
builtin/providers/aws/import_aws_ebs_volume_test.go
Normal file
27
builtin/providers/aws/import_aws_ebs_volume_test.go
Normal 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,
|
||||
},
|
||||
},
|
||||
})
|
||||
}
|
@ -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{
|
||||
|
@ -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{
|
||||
|
Loading…
Reference in New Issue
Block a user