From bafabf17be61aefbfe2e978ed2c12bcc927f43d3 Mon Sep 17 00:00:00 2001 From: Radek Simko Date: Thu, 30 Apr 2015 22:58:09 +0100 Subject: [PATCH] provider/aws: Expose zone_id from elb --- builtin/providers/aws/resource_aws_elb.go | 6 ++++++ website/source/docs/providers/aws/r/elb.html.markdown | 1 + 2 files changed, 7 insertions(+) diff --git a/builtin/providers/aws/resource_aws_elb.go b/builtin/providers/aws/resource_aws_elb.go index 1dd4c3f176..21d3b4ebc9 100644 --- a/builtin/providers/aws/resource_aws_elb.go +++ b/builtin/providers/aws/resource_aws_elb.go @@ -177,6 +177,11 @@ func resourceAwsElb() *schema.Resource { Computed: true, }, + "zone_id": &schema.Schema{ + Type: schema.TypeString, + Computed: true, + }, + "tags": tagsSchema(), }, } @@ -281,6 +286,7 @@ func resourceAwsElbRead(d *schema.ResourceData, meta interface{}) error { d.Set("name", *lb.LoadBalancerName) d.Set("dns_name", *lb.DNSName) + d.Set("zone_id", *lb.CanonicalHostedZoneNameID) d.Set("internal", *lb.Scheme == "internal") d.Set("availability_zones", lb.AvailabilityZones) d.Set("instances", flattenInstances(lb.Instances)) diff --git a/website/source/docs/providers/aws/r/elb.html.markdown b/website/source/docs/providers/aws/r/elb.html.markdown index 20b007f6ea..9947e42dbd 100644 --- a/website/source/docs/providers/aws/r/elb.html.markdown +++ b/website/source/docs/providers/aws/r/elb.html.markdown @@ -96,3 +96,4 @@ The following attributes are exported: * `source_security_group` - The name of the security group that you can use as part of your inbound rules for your load balancer's back-end application instances. +* `zone_id` - The canonical hosted zone ID of the ELB (to be used in a Route 53 Alias record)