Merge pull request #9125 from hashicorp/b-aws-r53-alias-refresh

provider/aws: aws_route53_record alias refresh manually updated record
This commit is contained in:
Paul Stack 2016-10-03 15:55:23 +01:00 committed by GitHub
commit 7cba88931a
1 changed files with 8 additions and 9 deletions

View File

@ -374,16 +374,15 @@ func resourceAwsRoute53RecordRead(d *schema.ResourceData, meta interface{}) erro
} }
if alias := record.AliasTarget; alias != nil { if alias := record.AliasTarget; alias != nil {
if _, ok := d.GetOk("alias"); !ok { name := strings.TrimSuffix(*alias.DNSName, ".")
d.Set("alias", []interface{}{ d.Set("alias", []interface{}{
map[string]interface{}{ map[string]interface{}{
"zone_id": *alias.HostedZoneId, "zone_id": *alias.HostedZoneId,
"name": *alias.DNSName, "name": name,
"evaluate_target_health": *alias.EvaluateTargetHealth, "evaluate_target_health": *alias.EvaluateTargetHealth,
}, },
}) })
} }
}
d.Set("ttl", record.TTL) d.Set("ttl", record.TTL)