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

Automatically select profile when AWS_PROFILE environment variable is set #271

Open
nl-brett-stime opened this issue Dec 30, 2020 · 1 comment

Comments

@nl-brett-stime
Copy link
Contributor

Expected Behavior

Optional new usage for those of us who wish to type less:

export AWS_PROFILE=foo
gimme-aws-creds                 # After the PR, gimme will recognize the same environment variable as the AWS CLI and SDK.
aws s3 ls                                # The AWS CLI already recognizes the AWS_PROFILE environment variable
aws ec2 describe-instances
terraform apply                      # Other tools built on an AWS SDK already recognize the AWS_PROFILE environment variable

Current Behavior

E.g., Existing usage with many explicit profile references:

gimme-aws-creds --profile foo
aws --profile foo s3 ls
aws --profile foo ec2 describe-instances
AWS_PROFILE=foo terraform apply

Possible Solution

PR inbound

@jcreyf
Copy link
Contributor

jcreyf commented Dec 2, 2022

I need this too but was not aware of this issue and PR for this request.
I basically created my own implementation with basically just 1 line change in config.py (I did add 2 more lines to display the selected profile on the console to inform the user).
https://github.com/jcreyf/gimme-aws-creds/blob/e4a5e5a43715dcbf436e4a2bb8d4e5a490571761/gimme_aws_creds/config.py#L177

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

2 participants