Conversation
avm/bin/avm
Outdated
| 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.
I believe you forgot to write into /.aws/config here.
There was a problem hiding this comment.
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.
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.
ror6ax
left a comment
There was a problem hiding this comment.
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
credentialsandconfigfiles, withcredentialsbeing 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.