Re: DNS - Getting a record from a route53 zone with thousands of records

679 views
Skip to first unread message

geemus (Wesley Beary)

unread,
Mar 26, 2013, 10:39:38 AM3/26/13
to ruby...@googlegroups.com
I think instead of find, you'll want get, so `zone.records.get(@record_name)`. That should return the single record matching that name (without needing to fetch all of them or deal with pagination). It should also be a good deal faster. Do let me know if you have other question or that doesn't take care of it for you though.
Thanks!
wes


On Tue, Mar 26, 2013 at 6:30 AM, Vidyanand <vidy...@gmail.com> wrote:
Hi 

I am trying to use fog to work with Amazon Route-53.  I have run into a situation where my zone has 1000's of records and I am trying to get hold of a record from that zone. 

$record = $zone.records.find{|r| r.name == @record_name }  returns when the @record_name starts with 'a' but when I use a record_name starts with 'b' this wont return even though a record with the name exists.  I bet it has got to do with number of records and not necessarily the alphabets.

How do I go about getting an handle to that record I am looking for even when the zones have thousands of records? 

Thanks



--
You received this message because you are subscribed to the Google Groups "ruby-fog" group.
To unsubscribe from this group and stop receiving emails from it, send an email to ruby-fog+u...@googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.
 
 

Vidyanand

unread,
Mar 26, 2013, 3:22:31 PM3/26/13
to ruby...@googlegroups.com
Geemus

I actually tried that and it wouldn't work. If you do it that way it seems to take it as resourceId and so it comes back with the exception that essentially boils down to 

1 validation error detected: Value 'xxx.xxx.mydomain.com.' at 'resourceId' failed to satisfy constraint: Member must have length less than or equal to 32. 

I should also note that the fog version I use is 0.9.0 or so. 

Thanks

geemus (Wesley Beary)

unread,
Mar 26, 2013, 4:14:41 PM3/26/13
to ruby...@googlegroups.com
Hmm. How are you setting up the zone?

Vidyanand

unread,
Mar 27, 2013, 1:41:02 AM3/27/13
to ruby...@googlegroups.com
This is what I am doing 

$dns = Fog::DNS.new({
  :provider               => 'AWS',
  :aws_access_key_id      => $aws_access_key_id,
  :aws_secret_access_key  => $aws_secret_access_key
})

$zone = $dns.zones.get( 'ABCDEFGHIJ')

And I try to get the zone from here. 

I have tried the following as well 

$record = $zone.records.get( {:name => 'xxx.xxx.mydomain.com.'} ) 

But this results in the following error 
`get_change': private method `sub' called for {:name=>"xxx.xxx.mydomain.com."}:Hash (NoMethodError)


Thanks

geemus (Wesley Beary)

unread,
Mar 27, 2013, 12:26:01 PM3/27/13
to ruby...@googlegroups.com
It looks like maybe $dns.zones.get would take an id instead of a domain, is that doing what you expect?

Could you open an issue around this at: https://github.com/fog/fog/issues/new

Seems like there must be a bug and I can probably get some specific (other peoples) attention there to help us out.

Thanks!
wes

Vidyanand

unread,
Mar 27, 2013, 2:16:19 PM3/27/13
to ruby...@googlegroups.com
It does look like get expects id. I was hoping to do the following

 $dns.list_resource_record_sets('ABCDEFGHIJ', { :name => ''xxx.xxx.mydomain.com.'})

It does return a non null object

But I am not sure how to iterate through the return type . Would that be something that you can help with . 

( If its not clear till now , I am a noob to ruby :) )

geemus (Wesley Beary)

unread,
Mar 27, 2013, 4:13:02 PM3/27/13
to ruby...@googlegroups.com
No worries, just continuing the discussion over on the issue for now. Hopefully we can sort you out soon. Thanks!

Vidyanand

unread,
Apr 2, 2013, 5:24:47 PM4/2/13
to ruby...@googlegroups.com
For the sake of others who might be running into the same issue:

Please refer to https://github.com/fog/fog/issues/1709 on how this got resolved. 

Thanks
Reply all
Reply to author
Forward
0 new messages