provider/aws: Add FQDN as output to route53_record

This commit is contained in:
Radek Simko 2015-05-07 12:54:53 +01:00 committed by Radek Simko
parent 6cd6703dfb
commit ce8351ddef
3 changed files with 9 additions and 1 deletions

View File

@ -3,6 +3,7 @@
IMPROVEMENTS:
* provider/aws: `aws_s3_bucket` exports `hosted_zone_id` and `region` [GH-1865]
* provider/aws: `aws_route53_record` exports `fqdn` [GH-1847]
BUG FIXES:

View File

@ -29,6 +29,11 @@ func resourceAwsRoute53Record() *schema.Resource {
ForceNew: true,
},
"fqdn": &schema.Schema{
Type: schema.TypeString,
Computed: true,
},
"type": &schema.Schema{
Type: schema.TypeString,
Required: true,
@ -216,6 +221,8 @@ func resourceAwsRoute53RecordRead(d *schema.ResourceData, meta interface{}) erro
return err
}
en := expandRecordName(d.Get("name").(string), *zoneRecord.HostedZone.Name)
log.Printf("[DEBUG] Expanded record name: %s", en)
d.Set("fqdn", en)
lopts := &route53.ListResourceRecordSetsInput{
HostedZoneID: aws.String(cleanZoneID(zone)),

View File

@ -106,5 +106,5 @@ Alias records support the following:
## Attributes Reference
No attributes are exported.
* `fqdn` - [FQDN](http://en.wikipedia.org/wiki/Fully_qualified_domain_name) built using the zone domain and `name`