mirror of
https://github.com/opentofu/opentofu.git
synced 2025-01-08 15:13:56 -06:00
aws/aws_vpc: import
This commit is contained in:
parent
420e13d2f2
commit
da353c3637
28
builtin/providers/aws/import_aws_vpc_test.go
Normal file
28
builtin/providers/aws/import_aws_vpc_test.go
Normal file
@ -0,0 +1,28 @@
|
||||
package aws
|
||||
|
||||
import (
|
||||
"testing"
|
||||
|
||||
"github.com/hashicorp/terraform/helper/resource"
|
||||
)
|
||||
|
||||
func TestAccAWSVpc_importBasic(t *testing.T) {
|
||||
resourceName := "aws_vpc.foo"
|
||||
|
||||
resource.Test(t, resource.TestCase{
|
||||
PreCheck: func() { testAccPreCheck(t) },
|
||||
Providers: testAccProviders,
|
||||
CheckDestroy: testAccCheckVpcDestroy,
|
||||
Steps: []resource.TestStep{
|
||||
resource.TestStep{
|
||||
Config: testAccVpcConfig,
|
||||
},
|
||||
|
||||
resource.TestStep{
|
||||
ResourceName: resourceName,
|
||||
ImportState: true,
|
||||
ImportStateVerify: true,
|
||||
},
|
||||
},
|
||||
})
|
||||
}
|
@ -18,6 +18,9 @@ func resourceAwsVpc() *schema.Resource {
|
||||
Read: resourceAwsVpcRead,
|
||||
Update: resourceAwsVpcUpdate,
|
||||
Delete: resourceAwsVpcDelete,
|
||||
Importer: &schema.ResourceImporter{
|
||||
State: schema.ImportStatePassthrough,
|
||||
},
|
||||
|
||||
Schema: map[string]*schema.Schema{
|
||||
"cidr_block": &schema.Schema{
|
||||
|
Loading…
Reference in New Issue
Block a user