Merge pull request #1847 from TimeIncOSS/add-fqdn-to-route53

provider/aws: Add expanded name as output to route53_record
This commit is contained in:
Radek Simko 2015-05-08 20:23:03 +01:00
commit 6409c5b826
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`