From ce8351ddef294cf0d5153fc2f96198a8992af0cf Mon Sep 17 00:00:00 2001 From: Radek Simko Date: Thu, 7 May 2015 12:54:53 +0100 Subject: [PATCH] provider/aws: Add FQDN as output to route53_record --- CHANGELOG.md | 1 + builtin/providers/aws/resource_aws_route53_record.go | 7 +++++++ .../docs/providers/aws/r/route53_record.html.markdown | 2 +- 3 files changed, 9 insertions(+), 1 deletion(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 242d782ffd48..226089ed9e54 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -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: diff --git a/builtin/providers/aws/resource_aws_route53_record.go b/builtin/providers/aws/resource_aws_route53_record.go index ad3795712731..268bf2d045fd 100644 --- a/builtin/providers/aws/resource_aws_route53_record.go +++ b/builtin/providers/aws/resource_aws_route53_record.go @@ -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)), diff --git a/website/source/docs/providers/aws/r/route53_record.html.markdown b/website/source/docs/providers/aws/r/route53_record.html.markdown index 11e059ebae34..8183258f3efb 100644 --- a/website/source/docs/providers/aws/r/route53_record.html.markdown +++ b/website/source/docs/providers/aws/r/route53_record.html.markdown @@ -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`