providers/aws: basic route 53 zone import

This commit is contained in:
Mitchell Hashimoto 2016-05-18 13:09:56 -06:00
parent f64f470807
commit 1c0a6bc6d3
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 TestAccAWSRoute53Zone_importBasic(t *testing.T) {
resourceName := "aws_route53_zone.main"
resource.Test(t, resource.TestCase{
PreCheck: func() { testAccPreCheck(t) },
Providers: testAccProviders,
CheckDestroy: testAccCheckRoute53ZoneDestroy,
Steps: []resource.TestStep{
resource.TestStep{
Config: testAccRoute53ZoneConfig,
},
resource.TestStep{
ResourceName: resourceName,
ImportState: true,
ImportStateVerify: true,
},
},
})
}

View File

@ -21,6 +21,9 @@ func resourceAwsRoute53Zone() *schema.Resource {
Read: resourceAwsRoute53ZoneRead,
Update: resourceAwsRoute53ZoneUpdate,
Delete: resourceAwsRoute53ZoneDelete,
Importer: &schema.ResourceImporter{
State: schema.ImportStatePassthrough,
},
Schema: map[string]*schema.Schema{
"name": &schema.Schema{