awscosts icon indicating copy to clipboard operation
awscosts copied to clipboard

ec2 is broken for certain regions

Open cohenaj194 opened this issue 7 years ago • 0 comments

When attempting to use the following:

def get_region_cost(region)
  return AWSCosts.region(region).ec2.on_demand(:linux).price
end

I found that certain regions cause the following error:

test.rb:22:in `get_region_cost': undefined method `ec2' for nil:NilClass (NoMethodError)
	from test.rb:28:in `block in get_ec2_costs'
	from test.rb:27:in `each'
	from test.rb:27:in `get_ec2_costs'
	from test.rb:33:in `<main>'

The following regions cause this issue:

ap-south-1
eu-west-2
ap-northeast-2
ca-central-1
us-east-2

cohenaj194 avatar Oct 20 '17 19:10 cohenaj194