rightscale/right_aws — Issue #95: ELB new - issue passing in :region as aws param
Author: danmiley
Created: 2011-11-03 19:35:13+00:00
State: open

When passing in a region in the constructor args (anything other than us-east) the server name doesnt resolve correctly, instead we see a double reference of the prefix. e.g. Opening new HTTPS connection to us-east-1.us-east-1.ec2.amazonaws.com:443
Note duplication of us-east-1 subdomain.

any help would be much appreciated! or advise as to how to effectively reference a specific, non-default region when attempting to access a given ELB. The examples all seem to be oriented towards the default region us-east, since a region param is never set. The region param approach as below works fine for ELB rightscale instances. thanks!

details:

I am using current right_aws gem within a capistrano script context.

given this ruby code:

set :aws_params, :region => 'us-west-1'

print 'params =' + fetch(:aws_params).to_s

@elb_api ||= RightAws::ElbInterface.new(fetch(:aws_access_key_id), fetch(:aws_secret_access_key), fetch(:aws_params, {})

print @elb_api.describe_load_balancers.to_s

I get the following.
, [2011-11-03T12:23:24.744988 #5478] INFO -- : New RightAws::Ec2 using shared connections mode
params = {:region=>"us-east-1", :server=>"us-east-1.ec2.amazonaws.com", :port=>443, :service=>"/", :protocol=>"https", :connection_options=>{}, :connections=>:shared, :max_connections=>10, :connection_lifetime=>1200, :api_version=>"201\
0-08-31"}I, [2011-11-03T12:23:24.745271 #5478] INFO -- : New RightAws::ElbInterface using shared connections mode
I, [2011-11-03T12:23:24.746190 #5478] INFO -- : Opening new HTTPS connection to us-east-1.us-east-1.ec2.amazonaws.com:443