providers/aws: customer gateway import

This commit is contained in:
Mitchell Hashimoto 2016-05-13 13:07:36 -07:00
parent 2a30178413
commit 4e3488afb8
No known key found for this signature in database
GPG Key ID: 744E147AA52F5B0A
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 TestAccAWSCustomerGateway_importBasic(t *testing.T) {
resourceName := "aws_customer_gateway.foo"
resource.Test(t, resource.TestCase{
PreCheck: func() { testAccPreCheck(t) },
Providers: testAccProviders,
CheckDestroy: testAccCheckCustomerGatewayDestroy,
Steps: []resource.TestStep{
resource.TestStep{
Config: testAccCustomerGatewayConfig,
},
resource.TestStep{
ResourceName: resourceName,
ImportState: true,
ImportStateVerify: true,
},
},
})
}

View File

@ -20,6 +20,9 @@ func resourceAwsCustomerGateway() *schema.Resource {
Read: resourceAwsCustomerGatewayRead, Read: resourceAwsCustomerGatewayRead,
Update: resourceAwsCustomerGatewayUpdate, Update: resourceAwsCustomerGatewayUpdate,
Delete: resourceAwsCustomerGatewayDelete, Delete: resourceAwsCustomerGatewayDelete,
Importer: &schema.ResourceImporter{
State: schema.ImportStatePassthrough,
},
Schema: map[string]*schema.Schema{ Schema: map[string]*schema.Schema{
"bgp_asn": &schema.Schema{ "bgp_asn": &schema.Schema{