Skip to content

Commit

Permalink
Merge pull request #1847 from TimeIncOSS/add-fqdn-to-route53
Browse files Browse the repository at this point in the history
provider/aws: Add expanded name as output to route53_record
  • Loading branch information
radeksimko committed May 8, 2015
2 parents 6cd6703 + ce8351d commit 6409c5b
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 1 deletion.
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -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:

Expand Down
7 changes: 7 additions & 0 deletions builtin/providers/aws/resource_aws_route53_record.go
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand Down Expand Up @@ -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)),
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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`

0 comments on commit 6409c5b

Please sign in to comment.