Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

provider/aws: aws_route53_record import error processing #11603

Merged
merged 1 commit into from
Feb 1, 2017
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 5 additions & 0 deletions builtin/providers/aws/resource_aws_route53_record.go
Original file line number Diff line number Diff line change
Expand Up @@ -459,6 +459,11 @@ func resourceAwsRoute53RecordRead(d *schema.ResourceData, meta interface{}) erro
// If we don't have a zone ID we're doing an import. Parse it from the ID.
if _, ok := d.GetOk("zone_id"); !ok {
parts := strings.Split(d.Id(), "_")

if len(parts) == 1 {
return fmt.Errorf("Error Importing aws_route_53 record. Please make sure the record ID is in the form ZONEID_RECORDNAME_TYPE (i.e. Z4KAPRWWNC7JR_dev_A")
}

d.Set("zone_id", parts[0])
d.Set("name", parts[1])
d.Set("type", parts[2])
Expand Down