Skip to main content

Yet Another AWS SSO - sync up AWS CLI v2 SSO login session to legacy CLI v1 credentials

Project description

yawsso

Pull Request Build Status codecov.io Build Status Coverage Status

Yet Another AWS SSO - sync up AWS CLI v2 SSO login session to legacy CLI v1 credentials.

Do I need it?

Prerequisite

TL;DR

pip install yawsso
  • Do your per normal SSO login and, have at least one org-level SSO login session cache:
aws sso login --profile=dev
  • To sync for all named profiles (e.g. dev, prod, stag, ...), then just:
yawsso
  • To sync default profile and all named profiles, do:
yawsso --default
  • To sync default profile only, do:
yawsso --default-only
  • To sync for selected named profile, do:
yawsso -p dev
  • To sync for multiple selected named profiles, do:
yawsso -p dev prod
  • To sync for default profile as well as multiple selected named profiles, do:
yawsso --default -p dev prod
  • To sync for all named profiles start with prefix pattern lab*, do:
(zsh)
yawsso -p 'lab*'

(bash)
yawsso -p lab*
  • To sync for all named profiles start with prefix pattern lab* as well as dev and prod, do:
yawsso -p 'lab*' dev prod
  • Use -e flag if you want a temporary copy-paste-able time-gated access token for an instance or external machine. It use default profile if no additional arguments pass. The main use case is for those who use default profile, and would like to PIPE like this aws sso login && yawsso -e | pbcopy. Otherwise for named profile, do yawsso -e -p dev.

    PLEASE USE THIS FEATURE WITH CARE SINCE ENVIRONMENT VARIABLES USED ON SHARED SYSTEMS CAN GIVE UNAUTHORIZED ACCESS TO PRIVATE RESOURCES:

yawsso -e
export AWS_ACCESS_KEY_ID=xxx
export AWS_SECRET_ACCESS_KEY=xxx
export AWS_SESSION_TOKEN=xxx
  • You can also use yawsso subcommand login to SSO login then sync all in one go:
yawsso login -h
yawsso login
yawsso login -e
yawsso login --this
yawsso login --profile dev
yawsso login --profile dev --this
  • Print help to see other options:
yawsso -h
  • Then, continue per normal with your daily tools. i.e.
    • cdk deploy ...
    • terraform ...
    • cw ls -p dev groups
    • awsbw -L -P dev

Develop

  • Create virtual environment, activate it and then:
make install
make test
python -m yawsso --trace version
  • Create issue or pull request welcome

License

MIT License

License: MIT

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

yawsso-0.5.0rc1.tar.gz (9.8 kB view details)

Uploaded Source

Built Distribution

yawsso-0.5.0rc1-py3-none-any.whl (9.4 kB view details)

Uploaded Python 3

File details

Details for the file yawsso-0.5.0rc1.tar.gz.

File metadata

  • Download URL: yawsso-0.5.0rc1.tar.gz
  • Upload date:
  • Size: 9.8 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.1.1 pkginfo/1.5.0.1 requests/2.23.0 setuptools/47.1.1 requests-toolbelt/0.9.1 tqdm/4.46.0 CPython/3.8.2

File hashes

Hashes for yawsso-0.5.0rc1.tar.gz
Algorithm Hash digest
SHA256 44793fcf45988d15405f6bd431cf5b084cc84c2f9402a5aa7e643ea842da75f3
MD5 16ea6045c54c976f3130f61fd4ac96b1
BLAKE2b-256 143e1b90fcbe96da92a6d8bfd4c6dd02c94e00f1632dafa1b7d61427326b228a

See more details on using hashes here.

File details

Details for the file yawsso-0.5.0rc1-py3-none-any.whl.

File metadata

  • Download URL: yawsso-0.5.0rc1-py3-none-any.whl
  • Upload date:
  • Size: 9.4 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.1.1 pkginfo/1.5.0.1 requests/2.23.0 setuptools/47.1.1 requests-toolbelt/0.9.1 tqdm/4.46.0 CPython/3.8.2

File hashes

Hashes for yawsso-0.5.0rc1-py3-none-any.whl
Algorithm Hash digest
SHA256 ba9bc246be3d50671af438b40a2ca6831912f8a652b786389ef8debdef474af0
MD5 8f9b49204a02f703a0b2ae841a11db56
BLAKE2b-256 04a9e8981892f567ba1b84eb099775f53cbe32359a4d9124fde8122297d23cfd

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