Merge pull request #7282 from hashicorp/import-aws-vpngateway

provider/aws: Support Import for `aws_vpn_gateway`
This commit is contained in:
James Nugent 2016-06-23 10:52:58 +03:00 committed by GitHub
commit c9a4f84caa
2 changed files with 31 additions and 0 deletions

View File

@ -0,0 +1,28 @@
package aws
import (
"testing"
"github.com/hashicorp/terraform/helper/resource"
)
func TestAccAWSVpnGateway_importBasic(t *testing.T) {
resourceName := "aws_vpn_gateway.foo"
resource.Test(t, resource.TestCase{
PreCheck: func() { testAccPreCheck(t) },
Providers: testAccProviders,
CheckDestroy: testAccCheckVpnGatewayDestroy,
Steps: []resource.TestStep{
resource.TestStep{
Config: testAccVpnGatewayConfig,
},
resource.TestStep{
ResourceName: resourceName,
ImportState: true,
ImportStateVerify: true,
},
},
})
}

View File

@ -18,6 +18,9 @@ func resourceAwsVpnGateway() *schema.Resource {
Read: resourceAwsVpnGatewayRead,
Update: resourceAwsVpnGatewayUpdate,
Delete: resourceAwsVpnGatewayDelete,
Importer: &schema.ResourceImporter{
State: schema.ImportStatePassthrough,
},
Schema: map[string]*schema.Schema{
"availability_zone": &schema.Schema{