Skip to main content

CLI to switch the aws cli default profile quickly

Project description

awsuse

A CLI tool to easily switch the AWS CLI active default profile by changing directly the ~/.aws/config and the ~/.aws/credentials file.

Instalation

pip install git+https://github.com/aflopes/awsuse.git

Usage

awsuse --help
Usage: awsuse [OPTIONS] SOURCE_PROFILE

Options:
  --credentials-file PATH     Path to aws cli credentials file
  --config-file PATH          Path to aws cli config file
  --token-code TEXT           MFA token code (applicable on MFA based
                              profiles)
  --session-duration INTEGER  Session duration in seconds (applicable on MFA
                              based profiles)
  --help                      Show this message and exit.

Supported profile types

  • Simple profiles
  • MFA Profiles
  • SSO profiles

Simple profiles

These are simple profiles that define only the aws_access_key_id and aws_secret_access_key credentials.

For these, it just copies the profile values defined in both credentials and config file into those files [default] section

MFA profiles

These are profiles that contain the key mfa_serial defined in the config file.

It uses the SOURCE_PROFILE definition, the token code (--token-code) to get a new session token with credentials from AWS STS and writes them into the [default] section of the credentials file. It also copies the profile configs into the config file [default] section

SSO profiles

These are profiles that contain the key sso_session defined in the config file.

For these profiles this CLI ony copies the profile config settings into the [default] section.

If the specified sso_session is expired, this CLI will not try to refresh it automaticaly.

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

awsuse-0.1.1.tar.gz (10.0 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

awsuse-0.1.1-py3-none-any.whl (10.4 kB view details)

Uploaded Python 3

File details

Details for the file awsuse-0.1.1.tar.gz.

File metadata

  • Download URL: awsuse-0.1.1.tar.gz
  • Upload date:
  • Size: 10.0 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: poetry/1.3.2 CPython/3.10.2 Darwin/21.2.0

File hashes

Hashes for awsuse-0.1.1.tar.gz
Algorithm Hash digest
SHA256 e61d989d45f065b4244dde65553eef1df304c6c18510b85661e9cfab39113ed4
MD5 6cf644f17f8defe362236f963a1fdbfa
BLAKE2b-256 1d9540301b22c4eb59b32aa8638e1c839e2a20883470a0eb639aae0e06df6813

See more details on using hashes here.

File details

Details for the file awsuse-0.1.1-py3-none-any.whl.

File metadata

  • Download URL: awsuse-0.1.1-py3-none-any.whl
  • Upload date:
  • Size: 10.4 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: poetry/1.3.2 CPython/3.10.2 Darwin/21.2.0

File hashes

Hashes for awsuse-0.1.1-py3-none-any.whl
Algorithm Hash digest
SHA256 83c0c13ba7e59e28cd4d882fb824275e07a6e10f521665f4a995b98107b6eedb
MD5 b3e4a76c977783b52e9418d299cf7b1b
BLAKE2b-256 acde2fb0d57520ac32bcfa5f85ff3cb2524a3655832e9dfbd4707ffb4457354e

See more details on using hashes here.

Supported by

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