Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Consider preferring the standard AWS env vars if set #37

Open
eriknelson opened this issue May 23, 2019 · 2 comments
Open

Consider preferring the standard AWS env vars if set #37

eriknelson opened this issue May 23, 2019 · 2 comments
Assignees

Comments

@eriknelson
Copy link
Contributor

A lot of the AWS tools respect the following env vars if found, over others:

AWS_ACCESS_KEY_ID="XXX"
AWS_SECRET_ACCESS_KEY="XXX"
AWS_DEFAULT_REGION="us-west-1"

I changed my env var's default region and couldn't figure out why the terminate playbook couldn't find an instance that I clearly had in us-west-1. Turns out my config.yaml file with the ansible vars was actually what was being used, and it was set to us-west-2.

Would it make sense to accept these env vars overall else, or is that not really a fair assumption I'm making?

@jmontleon
Copy link
Contributor

jmontleon commented May 23, 2019

With most of the ec2 modules you can use the env vars if the parameters are otherwise unset:
https://docs.ansible.com/ansible/latest/modules/ec2_module.html

https://docs.ansible.com/ansible/latest/modules/ec2_module.html#notes

I don't see AWS_DEFAULT_REGION in the list, but AWS_REGION and EC2_REGION at the least are valid. All you'd have to do is remove them from our config.yml if we kill this, I believe, and maybe comment out the region set in the config.yml.example by default.

https://github.com/fusor/origin3-dev/blob/master/ansible/roles/ec2_provision/defaults/main.yml#L7
https://github.com/fusor/origin3-dev/blob/master/config.yml.example#L12

And update the use for the change: https://github.com/fusor/origin3-dev#use

I'm fine with it if it makes others lives easier.

@jmontleon
Copy link
Contributor

I guess there's a handful of tasks we'd have to adjust as well:
https://github.com/fusor/origin3-dev/search?q=%22%7B%7B+ec2_region+%7D%7D%22&unscoped_q=%22%7B%7B+ec2_region+%7D%7D%22

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants