Skip to main content

Sync up AWS CLI v2 SSO login session to legacy CLI v1 credentials

Project description

dnxsso

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 dnxsso
  • 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:
dnxsso
  • To sync default profile and all named profiles, do:
dnxsso --default
  • To sync default profile only, do:
dnxsso --default-only
  • To sync for selected named profile, do:
dnxsso -p dev
  • To sync for multiple selected named profiles, do:
dnxsso -p dev prod
  • To sync for default profile as well as multiple selected named profiles, do:
dnxsso --default -p dev prod
  • To sync for all named profiles start with prefix pattern lab*, do:
(zsh)
dnxsso -p 'lab*'

(bash)
dnxsso -p lab*
  • To sync for all named profiles start with prefix pattern lab* as well as dev and prod, do:
dnxsso -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 && dnxsso -e | pbcopy. Otherwise for named profile, do dnxsso -e -p dev.

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

dnxsso -e
export AWS_ACCESS_KEY_ID=xxx
export AWS_SECRET_ACCESS_KEY=xxx
export AWS_SESSION_TOKEN=xxx
  • You can also use dnxsso subcommand login to SSO login then sync all in one go:
dnxsso login -h
dnxsso login
dnxsso login -e
dnxsso login --this
dnxsso login --profile dev
dnxsso login --profile dev --this
  • Print help to see other options:
dnxsso -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 dnxsso --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

dnxsso-0.5.0.tar.gz (9.7 kB view details)

Uploaded Source

Built Distribution

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

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

Uploaded Python 3

File details

Details for the file dnxsso-0.5.0.tar.gz.

File metadata

  • Download URL: dnxsso-0.5.0.tar.gz
  • Upload date:
  • Size: 9.7 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.2.0 pkginfo/1.5.0.1 requests/2.24.0 setuptools/49.2.1 requests-toolbelt/0.9.1 tqdm/4.48.2 CPython/3.8.5

File hashes

Hashes for dnxsso-0.5.0.tar.gz
Algorithm Hash digest
SHA256 13d9f1cdb9b577f895590eed5ef3c9a7d7aa969648a162d87dc8124c37f17f37
MD5 025717bf94fcf1a12fb047229832be5e
BLAKE2b-256 ed702ba143a1694b8788199dfc4481d693afb937dfb54e2f434f53e6c991939a

See more details on using hashes here.

File details

Details for the file dnxsso-0.5.0-py3-none-any.whl.

File metadata

  • Download URL: dnxsso-0.5.0-py3-none-any.whl
  • Upload date:
  • Size: 9.4 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.2.0 pkginfo/1.5.0.1 requests/2.24.0 setuptools/49.2.1 requests-toolbelt/0.9.1 tqdm/4.48.2 CPython/3.8.5

File hashes

Hashes for dnxsso-0.5.0-py3-none-any.whl
Algorithm Hash digest
SHA256 04f7af4f5c8c1ffe9918825e718ea776fb381a788ea025968a0280abade1f5e1
MD5 4c4b523f22765718fec549db2f972440
BLAKE2b-256 bb8c36ca47ae1e761a024138c306d046244cf6d735c4beef5c6ee518284504ce

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