-
Notifications
You must be signed in to change notification settings - Fork 4
Managing AWS profiles #67
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
Conversation
…ser to SetupConfig for clarity.
fe2c825
to
87e86db
Compare
I believe this PR is ready. I'm struggling to think of ways to pull this into more, smaller and focused PRs. Let's give reviewing this a go and if its too hard I can try again. |
I haven't done the full... pull/test/read code cycles of this PR... just purely a thought/question around your example:
is |
Actually reading the code makes me think the |
I landed on this for a couple reasons:
I had considered some other options but they really muddied the meaning or use of the tool. This seemed more elegant and reusuable for future cases. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
That took me a while to go through... Generally I'm happy with it... still confused about naming that variable... gotta reread your response.
aws-vault exec $AWS_PROFILE -- aws sts get-session | ||
``` | ||
|
||
#### How `add-profile` modifies your ~/.aws/config |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Probably should add a note that it will override existing configuration if you supply a profile name that already exists.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I added a note at the bottom of this section.
TBH I have no idea what I'd call it... cuz it's not like you're explicitly defining the source profile here so you can't call it that... I get that if you know your "base" account is in |
Yeah, its a tough problem. I'd love to get opinions on this because honestly its easy to change if folks hate it. I think the logic of the PR is sound, its this user interface that needs some attention. |
Bug: null pointer dereference when creating a new MFA device. Double check that this works. |
Fixed! |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
In this change we want to be able to handle a couple cases:
Setup
New
setup-new-aws-user setup
usage:You should see this output:
Add Profiles
The new subcommand allows for adding a new profile based on an existing profile. It's important to note that the assumption here is that the BASE account and the MFA will remain the same. If this was not true then I'd expect the user to run the
setup
subcommand instead of theadd-profile
sub command.New
setup-new-aws-user add-profile
usage:go run ./cmd/ add-profile
You should see this output:
Generates this in the
~/.aws/config
file:Testing
Try out the new tests with
make test
. To review test coverage you can runmake test_coverage
and view the covered code in the browser.References
Pivotal tickets: