Skip to content

Commit

Permalink
provider/aws: Add FQDN as output to route53_record
Browse files Browse the repository at this point in the history
  • Loading branch information
Radek Simko authored and radeksimko committed May 8, 2015
1 parent 6cd6703 commit ce8351d
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 ce8351d

Please sign in to comment.