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:
parent
1f036e7743
commit
e579c1c90f
|
@ -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{
|
||||
|
|
Loading…
Reference in New Issue