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

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

Prerequisite

TL;DR

pip install yawsso
  • Do your per normal SSO login and, have those SSO login session cache like so:
aws sso login --profile=dev
aws sso login --profile=prod
aws sso login --profile=stag
  • To sync for all named profiles (e.g. dev, prod, stag), then just:
yawsso
  • To sync default profile, do:
yawsso --default
  • 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 named profiles, do:
yawsso --default -p dev prod
  • Then, continue per normal with your daily tools. i.e.

    • cdk deploy ...
    • terraform ...
    • cw ls -p dev groups
    • awsbw -L -P dev
  • To print help:

yawsso -h

Why

AWS CLI v2 SSO login cache/store credentials is somewhat different to AWS CLI v1 i.e. no longer in ~/.aws/credentials. There are many SDK and tools still depends on this legacy ~/.aws/credentials format.

And, https://github.com/aws/aws-cli/issues/4982 in CLI repo itself!!

This tool is originally based on aws_sso.py script but take different approach and depends only on AWS CLI v2 for get-role-credentials. Well, everything else fail (including boto3) except CLI itself, so...

Someday, we won't need this anymore. But, until then this tool sync up AWS CLI v2 SSO login session to legacy format auto-magically!!

Others

If this tools is not working for you, try the following:

Develop

  • Create virtual environment and then:
pip install '.[dev,test]' .
pytest
python -m unittest
python -m yawsso --debug
  • 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.3.0.tar.gz (5.6 kB view details)

Uploaded Source

Built Distribution

yawsso-0.3.0-py3-none-any.whl (6.8 kB view details)

Uploaded Python 3

File details

Details for the file yawsso-0.3.0.tar.gz.

File metadata

  • Download URL: yawsso-0.3.0.tar.gz
  • Upload date:
  • Size: 5.6 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.1.1 pkginfo/1.5.0.1 requests/2.23.0 setuptools/46.0.0 requests-toolbelt/0.9.1 tqdm/4.46.0 CPython/3.7.7

File hashes

Hashes for yawsso-0.3.0.tar.gz
Algorithm Hash digest
SHA256 a7fff92daeb35ac641f2b3a224c02920c75d68a2f7812e4cf3b9a257d16bc6dd
MD5 c6c146bf86aa16492c2284586145c24a
BLAKE2b-256 287006474d6df1910ddbea98a6d64a352704f7bc53441860f0646c98cacb7ed7

See more details on using hashes here.

File details

Details for the file yawsso-0.3.0-py3-none-any.whl.

File metadata

  • Download URL: yawsso-0.3.0-py3-none-any.whl
  • Upload date:
  • Size: 6.8 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/46.0.0 requests-toolbelt/0.9.1 tqdm/4.46.0 CPython/3.7.7

File hashes

Hashes for yawsso-0.3.0-py3-none-any.whl
Algorithm Hash digest
SHA256 5587941c270efff5e13cdf97f85670cd0ac5371083b459554e9c834ceae223be
MD5 60b6e91b39a99783000ee0ba256ec4cb
BLAKE2b-256 0288beef507d4b18abf80272f755b3a326c2cafef3e20614279517fe011af724

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