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