provider/aws: Add import to route53 record

Allows the user to run:

```
terraform import aws_route53_record.record_name <record_id>
```

Fixes: #10941
This commit is contained in:
Jake Champlin 2017-01-11 17:38:02 -05:00
parent 1f036e7743
commit e579c1c90f
No known key found for this signature in database
GPG Key ID: DC31F41958EF4AC2
2 changed files with 31 additions and 1 deletions

View File

@ -0,0 +1,28 @@
package aws
import (
"testing"
"github.com/hashicorp/terraform/helper/resource"
)
func TestAccAwsRoute53Record_importBasic(t *testing.T) {
resourceName := "aws_route53_record.default"
resource.Test(t, resource.TestCase{
PreCheck: func() { testAccPreCheck(t) },
Providers: testAccProviders,
CheckDestroy: testAccCheckRoute53RecordDestroy,
Steps: []resource.TestStep{
{
Config: testAccRoute53RecordConfig,
},
{
ResourceName: resourceName,
ImportState: true,
ImportStateVerify: true,
ImportStateVerifyIgnore: []string{"weight"},
},
},
})
}

View File

@ -27,7 +27,9 @@ func resourceAwsRoute53Record() *schema.Resource {
Read: resourceAwsRoute53RecordRead,
Update: resourceAwsRoute53RecordUpdate,
Delete: resourceAwsRoute53RecordDelete,
Importer: &schema.ResourceImporter{
State: schema.ImportStatePassthrough,
},
SchemaVersion: 2,
MigrateState: resourceAwsRoute53RecordMigrateState,
Schema: map[string]*schema.Schema{