appoxy / aws

Amazon Web Services (AWS) Ruby Gem
https://rubygems.org/gems/aws
236 stars 87 forks source link

No Hosted Zone Name or ID in ELB balancer descriptions #102

Open davidljung opened 12 years ago

davidljung commented 12 years ago

In order to setup Route53 DNS records using the Zone apex feature requires the ELB Hosted Zone ID. Unless I'm missing something, there seems to be no way to obtain that for an ELB via Aws::Elb.describe_load_balancers(). This may be because it was only added after the Zone apex feature was added to Route53.

treeder commented 12 years ago

Hi David, any chance you could provide a patch/pull request for this? I personally haven't used Route 53 yet so probably won't be too motivated to add this for a while.

davidljung commented 12 years ago

I've managed to 'hack' the Aws::Elb class to get the information out of the response. However, I'm not currently proficient enough at Ruby to confidently implement full support for the latest ELB API version (- nor have I any experience creating patches, pull requests or using github) - yet.

Here is what I learned, however:

  1. The ELB API version used by Elb is 2009-05-15 - the oldest there is. There have been many API revisions since then, with the latest being 2011-11-15.
  2. The first revision of the ELB API (version 2009-05-15) changed the response such that the "Listeners" property was renamed "ListenerDescriptions". That needs to be updated on line 234. I don't know if other code changes are needed.
  3. The hosted zone properties were added in API version 2011-04-05 and are named "CanonicalHostedZoneNameID" and "CanonicalHostedZoneName" (the name, while a FQDN, isn't necessarily the same as the DNSName). I simply added two extra when clauses to the case on line 251.

I'm guessing there are other changes required for full compatibility with API version 2011-11-15. Sorry I can't be of more help. If I do make changes that I'm confident update it fully to the newer API and don't break anything, I'll figure out how to send a patch.