fog/fog — Issue #660: Do you need to hard code EC2 regions?
Author: thattommyhall
Created: 2011-12-15 11:25:38+00:00
State: open

aws = Fog::Compute.new(ec2credentials.merge({:provider=>'AWS'}))
@regions = aws.describe_regions.body["regionInfo"].map {|region| region["regionName"]}
@compute = {}
@regions.each do |region|
@compute.merge!(region => Fog::Compute.new(ec2credentials.merge({:provider=>'AWS',:region=>region})))
end

I use the above code to create a connection to each region and put them in a hash keyed by region name but it breaks whenever amazon release a new region. Can we not make amazon the source of truth for what regions exist instead of hard coding them in fog?

Thanks.
Tom Hall