Package: aws-profile-manager
AWS Profile ManagerThe tool which allows you to jump between your profiles in your~/.aws/credentialsProblematicsWell, if you are operating only one AWS account then you will not find this util useful. Problem appears when there are more than 3 accounts under your control. Sure, you can use--profileflag with any your aws cli command. But what if you need to run number of commands for several accounts, then make sure you don't forget to add--profileto your command or specified the right profile name.
Another example is about Hashicorp Terraform. Let's imagine that you have one module which you need to apply for several accounts. Unfortunately, terraform doesn't allow you to specify--profileand that's logically since Terraform is not about AWS. So, you will need to hardcode your AWS_ACCESS_KEY_ID and AWS_SECRET_ACCESS_KEY or go to~/.aws/credentialsand change the[default]profile.How to installThat's easy just runsudo pip install aws-profile-managerOrclonethis repository and runmake installUsageUsage: aws-profile-manager [OPTIONS] COMMAND [ARGS]...

  This tool's subcommands are loaded from a plugin folder dynamically.

Options:
  --version    Show the version and exit.
  -q, --quiet  Less outputs
  --help       Show this message and exit.

Commands:
  profile-add      Add new AWS profile to your ~/.aws/credentials
  profile-current  Shows current default AWS profile from your ~/.aws/credentials
  profile-edit     Edit AWS profile from your ~/.aws/credentials
  profile-list     Shows all AWS profile from your ~/.aws/credentials
  profile-remove   Removes AWS profile from your ~/.aws/credentials
  profile-switch   Switch default AWS profile in your ~/.aws/credentials
  rotate-keys      Rotate keys for defined profile ~/.aws/credentialsHow does it workAdd profileAllows to add new profile to your~/.aws/credentialsTo runprofile-addin interactive run next commandaws-profile-manager profile-addOr you can specify everything inlineaws-profile-manager profile-add --aws-profile-name=your-profile-name --aws-access-key-id=AKIAAAAAAAAAAAAAAAAA --aws-secret-access-key=Aa1Aa0az00+AzA/01AzZZZz0Z0z0ZzzZZzZZz0zZEdit profileAllows to edit existing profile in your~/.aws/credentialsTo runprofile-editin interactive run next commandaws-profile-manager profile-editOr you can specify everything inlineaws-profile-manager profile-edit --aws-profile-name=your-profile-name --aws-access-key-id=AKIAAAAAAAAAAAAAAAAA --aws-secret-access-key=Aa1Aa0az00+AzA/01AzZZZz0Z0z0ZzzZZzZZz0zZRemove profileAllows to add remove profile from your~/.aws/credentialsTo runprofile-removein interactive mode run next commandaws-profile-manager profile-removeOr you can specify the profile inline and confirm that you understand that profile will be removed from your file using flag--yesaws-profile-manager profile-remove --aws-profile-name=your-profile-name --yesSwitch profileMakes a specified profile default in your~/.aws/credentialsTo runprofile-switchin interactive mode run next commandaws-profile-manager profile-switchUnfortunately, there is no inline option here, but I swear it will be added in the nearest futureList profilesShows all AWS profile from your~/.aws/credentialsand exitsaws-profile-manager profile-listRotate keysRotate keys for defined profile~/.aws/credentialsTo runrotate-keysin interactive mode run next commandaws-profile-manager rotate-keysOr you can specify the profile inline and confirm that you understand that keys for profile will be rotated using flag--yesaws-profile-manager rotate-keys --aws-profile-name=your-profile-name --yes:warning: Be careful in case you specified--yesflag since you will not see tips regarding your keys. Rotation will DELETE your key second key if such exists since there may be only two keys per user and the rotation procedure requires to create new key before deleting an old one
Also, you can make the rotaton on a regular basis using cron. Simply add this line to yourcrontab.crontab -eIn order to rotate on monthly basis add next line@monthly aws-profile-manager rotate-keys --aws-profile-name=your-profile-name --yes