CredentialTraverser enables you to execute AWS API Actions by using every profile specified in ~/.aws/credentials
Add this line to your application's Gemfile:
gem 'credential_traverser'
And then execute:
$ bundle
Or install it yourself as:
$ gem install credential_traverser
sample code using credential_traverser is below:
require 'aws-sdk-v1'
require 'credential_traverser'
CredentialTraverser.traverse do |profile|
ec2 = AWS::EC2.new
puts "#{profile} : #{ec2.instances.count}"
endThen you can see the following outputs:
default : 5
other_profile : 2
another_profile : 0
...
- Fork it ( https://github.com/[my-github-username]/credential_traverser/fork )
- Create your feature branch (
git checkout -b my-new-feature) - Commit your changes (
git commit -am 'Add some feature') - Push to the branch (
git push origin my-new-feature) - Create a new Pull Request