-
Notifications
You must be signed in to change notification settings - Fork 573
Add support for AWS config and credential files #441
Conversation
When either access_key_id or secret_access_key are not set it will attempt to read from environment variables, if those are empty then it will attempt to read from config and credentials. It allows choosing a profile (by default it's [default]) and an "info" directory (by default $HOME/.aws). Supported information: region, aws_access_key_id, aws_secret_access_key and aws_session_token.
AWS info (credentials and config) verification is done at validate and the error message is read from the locales yml file.
Thanks for the work getting this started. We've been looking for something like this as well. Two things:
|
Test case: with EC2 credential environment variables set
Test case: without EC2 credential environment variables but with AWS_CONFIG_FILE and AWS_SHARED_CREDENTIALS_FILE set
Add support for AWS shared credentials location environment variables AWS_CONFIG_FILE and AWS_SHARED_CREDENTIALS_FILE
@ThatGerber I've implemented 1) and 2). |
Updated description:
The mandatory fields for a successful "get credentials" are the id and the secret keys. It also allows choosing a profile (by default it's [default]) and an "info" |
@rtyler Any chance for this and the other PRs to get some love? |
@mitchellh is anyone actively maintaining this project? |
@mitchellh don't understand why packer is reading ~/.aws/credentials but vagrant-aws is not. Please look into merging |
@@ -7,6 +7,7 @@ group :development do | |||
# gem dependency because we expect to be installed within the | |||
# Vagrant environment itself using `vagrant plugin`. | |||
gem "vagrant", :git => "https://github.com/mitchellh/vagrant.git" | |||
gem 'iniparse', '~> 1.4', '>= 1.4.2' |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This gem is referred to in vagrant-aws/config.rb
so I'm not clear on why it is in the :development
group of this Gemfile instead of as a dependency listed in the gemspec proper.
@rtyler I believe I fixed the gemspec issue. |
@rtyler any updates on this? |
Add support for AWS config and credential files
If possible, I'd love to see a new gem released that includes this change. |
I have this error after applying this PR:
My config file is like:
What's wrong? |
@kenorb You are configuring your profiles incorrectly, that's why it's not working. http://docs.aws.amazon.com/cli/latest/userguide/cli-chap-getting-started.html#cli-multiple-profiles The method is that config files should have [profile NAME]. Credentials files are set up as [NAME]. |
When either access_key_id or secret_access_key are not set it will attempt to read from environment variables, if those are empty then it will attempt to read from config and credentials.
It allows choosing a profile (by default it's "default") and an "info" directory (by default $HOME/.aws).
Supported information: region, aws_access_key_id, aws_secret_access_key and aws_session_token.
Closes issue #151