Automatically selects config section matching AWS_PROFILE #272
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
When a user has exported an AWS_PROFILE environment variable, the logic in this PR will find a matching section in ~/.okta_aws_login_config, if configured.
Description
See motivation section below.
To enable the new feature for a given profile, the corresponding section in ~/.okta_aws_login_config must add a new attribute e.g., the following...
...would activate the profile when the AWS_PROFILE environment variable is set to
foo
Related Issue
#271
Motivation and Context
E.g., Existing usage with many explicit profile references:
Optional new usage for those of us who wish to type less:
How Has This Been Tested?
I'm using it locally. If I have more time in the near future, I may provide additional documentation and testing. I tried to make the new feature at least a little bit self-discoverable without external documentation. I also did some manual testing for the existing cases.
For some reason, if I run
nosetests --verbosity=2 tests/
, I get errors like the ones below, even though I ranpip3 install -r requirements.txt
:Screenshots (if appropriate):
Types of changes
Checklist: