-
Notifications
You must be signed in to change notification settings - Fork 573
Allow getting credentials from environment variables #33
Conversation
Amazon's EC2 tools use the environment variables AWS_ACCESS_KEY and AWS_SECRET_KEY to store credentials. This commit allows vagrant-aws to get credentials in the same way, reducing the risk of leaking them by removing the need to store them in the Vagrantfile.
@kmrhb You can just put them in your VagrantFile in your ~/.vagrant.d directory. That way you dont have to commit them in your projects VagrantFile. More info: #1 |
@johntdyer good to know. Just found out about the config merging in vagrant. I thought I'd been through all the docs in the past, but I guess not. I know I still think there is value in getting the credentials from the environment. In my setup, my secret key is stored encrypted in my keychain on OS X. I run a bash command to load the keys into my environment for when I want to use EC2 commands. This way my credentials are never stored unencrypted on my filesystem, and I can control which processes I run can see them. |
For what it's worth, I do both: I load keys from ENV in This is what I use currently:
By setting or unsetting |
Although you can do this in the Vagrantfile, I'm okay with merging this in since it is the normal expected EC2 behavior. Merging! Thanks. |
Allow getting credentials from environment variables
This is cool, but isn't the standard AWS_ACCESS_KEY_ID and AWS_SECRET_ACCESS_KEY? |
This may or may not be relevant for what you're trying to do, but I like to use the dotenv gem as a vagrant plugin ( |
Amazon's EC2 tools use the environment variables AWS_ACCESS_KEY and
AWS_SECRET_KEY to store credentials. This commit allows vagrant-aws to
get credentials in the same way, reducing the risk of leaking them by
removing the need to store them in the Vagrantfile.
NB This is the first time I ever write any Ruby, so some style or organisation changes might be needed on the tests.