Merge pull request #8646 from hashicorp/b-aws-r53-delete

provider/aws: Wait for `aws_route_53_record` to be in-sync after a delete
This commit is contained in:
Paul Stack 2016-09-03 23:13:20 +03:00 committed by GitHub
commit 4a8158c1c0
2 changed files with 41 additions and 1 deletions

View File

@ -528,7 +528,18 @@ func resourceAwsRoute53RecordDelete(d *schema.ResourceData, meta interface{}) er
ChangeBatch: changeBatch,
}
_, err = deleteRoute53RecordSet(conn, req)
respRaw, err := deleteRoute53RecordSet(conn, req)
if err != nil {
return errwrap.Wrapf("[ERR]: Error building changeset: {{err}}", err)
}
changeInfo := respRaw.(*route53.ChangeResourceRecordSetsOutput).ChangeInfo
err = waitForRoute53RecordSetToSync(conn, cleanChangeID(*changeInfo.Id))
if err != nil {
return err
}
return err
}

View File

@ -454,6 +454,35 @@ resource "aws_route53_record" "default" {
records = ["127.0.0.1", "127.0.0.27"]
}
`
const testAccRoute53RecordConfigCNAMERecord = `
resource "aws_route53_zone" "main" {
name = "notexample.com"
}
resource "aws_route53_record" "default" {
zone_id = "${aws_route53_zone.main.zone_id}"
name = "host123.domain"
type = "CNAME"
ttl = "30"
records = ["1.2.3.4"]
}
`
const testAccRoute53RecordConfigCNAMERecordUpdateToCNAME = `
resource "aws_route53_zone" "main" {
name = "notexample.com"
}
resource "aws_route53_record" "default" {
zone_id = "${aws_route53_zone.main.zone_id}"
name = "host123.domain"
type = "A"
ttl = "30"
records = ["1.2.3.4"]
}
`
const testAccRoute53RecordConfig_fqdn = `
resource "aws_route53_zone" "main" {
name = "notexample.com"