Merge pull request #11162 from hashicorp/f-add-route53-record-import-10941

provider/aws: Add import to route53 record
This commit is contained in:
Jake Champlin 2017-01-12 12:08:46 -05:00 committed by GitHub
commit a2c0b85b2d
3 changed files with 40 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{

View File

@ -133,3 +133,12 @@ Weighted routing policies support the following:
## Attributes Reference
* `fqdn` - [FQDN](https://en.wikipedia.org/wiki/Fully_qualified_domain_name) built using the zone domain and `name`
## Import
Route53 Records can be imported using ID of the record, e.g.
```
$ terraform import aws_route53_record.myrecord Z4KAPRWWNC7JR_dev.example.com_NS
```