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

Respect AWS_SHARED_CREDENTIALS_FILE environment variable when set #223

Merged
merged 2 commits into from
Feb 2, 2024

Conversation

endorama
Copy link
Contributor

Hello, while using the CLI I noticed that the path for AWS credentials is hardcoded to $HOME/.aws/credentials. While this is fine, it does not respect AWS_SHARED_CREDENTIALS_FILE env var, which may be used to specify the location of such credential file.

AWS_SHARED_CREDENTIALS_FILE is a documented AWS CLI environment variable, see https://docs.aws.amazon.com/cli/latest/userguide/cli-configure-envvars.html

This PR adds support for reading the value and configuring internal AwsAuth fields with the value extracted from it.

In this implementation the environment variable takes precedence over the default $HOME/.aws location, which is used as fallback when the environment variable is not present and to my understanding is how the AWS CLI works.

Thank you for considering this contribution!

AWS_SHARED_CREDENTIALS_FILE is a documented AWS CLI environment
variable that can be used to specify the location of the
credentials file.

Support reading the value and configuring internal AwsAuth fields
with the value extracted from it.

See https://docs.aws.amazon.com/cli/latest/userguide/cli-configure-envvars.html

In this implementation the environment variable takes precedence
over the default $HOME/.aws location, which is used as fallback
when the environment variable is not present.
@maxtacu
Copy link
Member

maxtacu commented Feb 2, 2024

Thanks for your contribution! Sorry for the delay in review and merge.

@maxtacu maxtacu merged commit c737d81 into okta-awscli:main Feb 2, 2024
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

Successfully merging this pull request may close these issues.

None yet

2 participants