-
Notifications
You must be signed in to change notification settings - Fork 1
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
Update config when changing profile #4
base: master
Are you sure you want to change the base?
Conversation
avm/bin/avm
Outdated
@@ -49,7 +57,7 @@ if args.add: | |||
config.add_section(args.alias) | |||
config[args.alias]["aws_access_key_id"] = row['Access key ID'] | |||
config[args.alias]["aws_secret_access_key"] = row['Secret access key'] | |||
with open(home_creds, 'w') as configfile: | |||
with open(home_credentials, 'w') as configfile: |
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 believe you forgot to write into /.aws/config
here.
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.
There is no need to add to ~/.aws/config
if ~/.aws/credentials
holds the configuration details, but I think it would be better practise if the fields were split between the two files. Is that what you were thinking? So all fields except aws_access_key_id
and aws_secret_access_key
would go into ~/.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.
I was thinking about it more and it doesn't seem like we would want any other fields written from the .csv file except those two... I've updated the variable names to make it more clear that only the ~/.aws/credentials
file is being manipulated with the --add
option.
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.
Thanks, looks good here. There's only one comment and I'd also ask you to add a mention of this functionality in the readme, ok?
I addressed your concern with the |
AWS CLI pulls from both
credentials
andconfig
files, withcredentials
being preferred (see the docs). The changes in this PR will cause the default profile in both files to be updated.This PR addresses issue #2 and includes minor refactoring.