Merge pull request #11162 from hashicorp/f-add-route53-record-import-10941
provider/aws: Add import to route53 record
This commit is contained in:
commit
a2c0b85b2d
|
@ -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"},
|
||||
},
|
||||
},
|
||||
})
|
||||
}
|
|
@ -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{
|
||||
|
|
|
@ -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
|
||||
```
|
Loading…
Reference in New Issue