Skip to main content

This util allows you to manager your AWS profiles like add, remove, update and switch default AWS CLI profile

Project description

AWS Profile Manager

Actions Status PyPI version GitHub License Commit Activity

The tool which allows you to jump between your profiles in your ~/.aws/credentials

Problematics

Well, 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 --profile flag 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 --profile to 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 --profile and 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/credentials and change the [default] profile.

How to install

That's easy just run

sudo pip install aws-profile-manager

Or clone this repository and run

make install

Usage

Usage: 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/credentials

How does it work

Add profile

Allows to add new profile to your ~/.aws/credentials To run profile-add in interactive run next command

aws-profile-manager profile-add

Or you can specify everything inline

aws-profile-manager profile-add --aws-profile-name=your-profile-name --aws-access-key-id=AKIAAAAAAAAAAAAAAAAA --aws-secret-access-key=Aa1Aa0az00+AzA/01AzZZZz0Z0z0ZzzZZzZZz0zZ

Edit profile

Allows to edit existing profile in your ~/.aws/credentials To run profile-edit in interactive run next command

aws-profile-manager profile-edit

Or you can specify everything inline

aws-profile-manager profile-edit --aws-profile-name=your-profile-name --aws-access-key-id=AKIAAAAAAAAAAAAAAAAA --aws-secret-access-key=Aa1Aa0az00+AzA/01AzZZZz0Z0z0ZzzZZzZZz0zZ

Remove profile

Allows to add remove profile from your ~/.aws/credentials To run profile-remove in interactive mode run next command

aws-profile-manager profile-remove

Or you can specify the profile inline and confirm that you understand that profile will be removed from your file using flag --yes

aws-profile-manager profile-remove --aws-profile-name=your-profile-name --yes

Switch profile

Makes a specified profile default in your ~/.aws/credentials To run profile-switch in interactive mode run next command

aws-profile-manager profile-switch

Unfortunately, there is no inline option here, but I swear it will be added in the nearest future

List profiles

Shows all AWS profile from your ~/.aws/credentials and exits

aws-profile-manager profile-list

Rotate keys

Rotate keys for defined profile ~/.aws/credentials To run rotate-keys in interactive mode run next command

aws-profile-manager rotate-keys 

Or you can specify the profile inline and confirm that you understand that keys for profile will be rotated using flag --yes

aws-profile-manager rotate-keys --aws-profile-name=your-profile-name --yes

:warning: Be careful in case you specified --yes flag 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 your crontab.

crontab -e

In order to rotate on monthly basis add next line

@monthly aws-profile-manager rotate-keys --aws-profile-name=your-profile-name --yes

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

aws-profile-manager-0.7.3.tar.gz (12.4 kB view details)

Uploaded Source

Built Distribution

aws_profile_manager-0.7.3-py3-none-any.whl (18.2 kB view details)

Uploaded Python 3

File details

Details for the file aws-profile-manager-0.7.3.tar.gz.

File metadata

  • Download URL: aws-profile-manager-0.7.3.tar.gz
  • Upload date:
  • Size: 12.4 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/4.0.2 CPython/3.8.17

File hashes

Hashes for aws-profile-manager-0.7.3.tar.gz
Algorithm Hash digest
SHA256 457843fe09dccf8aed7e1760aa06f082f77a2bc17b4ced5cae4c56da39a5e01e
MD5 d073a1942c6b3693fccdc96451f9fb35
BLAKE2b-256 1adeb07168ba5891de7c37d8efb448f00b89e7ca1bd8bf02bd8b59a588947b69

See more details on using hashes here.

File details

Details for the file aws_profile_manager-0.7.3-py3-none-any.whl.

File metadata

File hashes

Hashes for aws_profile_manager-0.7.3-py3-none-any.whl
Algorithm Hash digest
SHA256 a00b28c2451ddc0c41f0bf7bf0c080c9a12e9ea4fd79b2ab5524fd442c41174f
MD5 dc2d021f543ec12c61f96500fbba2778
BLAKE2b-256 e24565ab201d5fed47e274e227aea1dd65a2f8ec5c07fa33f7e969d487d234e3

See more details on using hashes here.

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page