amazon-archives / aws-sdk-core-ruby

This repository has moved to the master branch of aws/aws-sdk-ruby
https://github.com/aws/aws-sdk-ruby
243 stars 57 forks source link

Added region to Aws::SharedCredentials #213

Closed jimcroft closed 9 years ago

jimcroft commented 9 years ago

Shared credential ini style files can contain a region setting which is used as a default by tools like the AWS CLI. I'd like the Aws::SharedCredentials object to provide me with that optional region setting for use in my Ruby code.

coveralls commented 9 years ago

Coverage Status

Coverage decreased (-0.05%) to 93.98% when pulling 585cb5d44e0c9025ed2421a9722ad6b434ae8b50 on jimcroft:feature/add_region_to_sharedcredentials into 3f2a3e0d5476e1ce9195e09cd85e250099f66905 on aws:master.

trevorrowe commented 9 years ago

I was under the impression that the ~/.aws/credentials file could/should only define credentials and that the region had to go into the ~/.aws/config file. Can you verify @jamesls ?

jimcroft commented 9 years ago

I can confirm that region is honoured if set in ~/.aws/credentials. The docs do look a little muddled here as they also say "The AWS CLI will also read credentials from the config file". It looks like credentials and config files can be used interchangeably with only a slight difference in format (eg. [name] vs. [profile name]).

Based on this I think this PR is incomplete as ~/.aws/config should be inspected for a default region too.

trevorrowe commented 9 years ago

I'm going to close this issue so that we can continue the discussion at the master repository over here: https://github.com/aws/aws-sdk-ruby/pull/703