Skip to content

Conversation

@kmendler
Copy link

@kmendler kmendler commented Oct 5, 2019

AWS CLI pulls from both credentials and config files, with credentials 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.

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:
Copy link
Owner

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.

Copy link
Author

@kmendler kmendler Oct 13, 2019

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?

Copy link
Author

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.

Copy link
Owner

@ror6ax ror6ax left a 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?

@kmendler
Copy link
Author

I addressed your concern with the --add option and the updates to the README. Let me know if there's anything else you'd like :)

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.

2 participants