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

cli-option "--profile" #9

Closed
AntonUspishnyi opened this issue Sep 17, 2020 · 4 comments
Closed

cli-option "--profile" #9

AntonUspishnyi opened this issue Sep 17, 2020 · 4 comments

Comments

@AntonUspishnyi
Copy link

AntonUspishnyi commented Sep 17, 2020

Hi,

I have several profiles in my .aws/credentials and don't have the [default] one.
So, I can't choose which profile to use (for example like in aws-cli) and have an error:

2020/09/17 14:37:23 unable to load regions: failed to query regions: EC2RoleRequestError: no EC2 instance role found
caused by: exceeded maximum number of attempts, 3, request send failed, Get "http://169.254.169.254/latest/meta-data/iam/security-credentials/": dial tcp 169.254.169.254:80: connect: host is down

It's because after checking default profile in .aws/credentials and envs - it tries to use InstanceRole.
I think it will be very convenient (for example):

awsets list --include iam/user --profile dev

Do you think the --profile arg will be useful?

@jcarter3
Copy link
Contributor

Yes - that would be extremely helpful. Some of the logic will need to be cleaned up to make this happen though. In the meantime the workaround would to set the profile as an env var prior to running:
AWS_PROFILE=<profile> awsets list...

@terryrankine
Copy link

I did discover env var profile support by accident too!
perfect undocumented work around - but i definitely like the option for command line

@AntonUspishnyi
Copy link
Author

Hi @jcarter3
Thank you for the workaround, it's very helpful for me.

jcarter3 pushed a commit that referenced this issue Sep 22, 2020
- update cache to better support global resources
@jcarter3
Copy link
Contributor

This is now available in the v0.4.0 release!

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