Yet Another AWS SSO - sync up AWS CLI v2 SSO login session to legacy CLI v1 credentials
Project description
yawsso
Yet Another AWS SSO - sync up AWS CLI v2 SSO login session to legacy CLI v1 credentials.
Prerequisite
- Required AWS CLI v2
- Assume you have already setup AWS SSO for your organization
TL;DR
- Install latest from PyPI like so:
pip install yawsso
- Do your per normal SSO login like so:
aws configure sso
aws sso login --profile=dev
- To sync for
default
profile, just:
yawsso
- To sync for named profile, do:
yawsso -p dev
-
Then, continue per normal with your daily tools. i.e.
cdk deploy ...
orterraform ...
orcw ls -p dev groups
orawsbw -L -P dev
- so on so ford...
-
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.
- boto3 - https://github.com/boto/boto3/issues/2091
- botocore - https://github.com/boto/botocore/issues/1988
- terraform aws provider - https://github.com/terraform-providers/terraform-provider-aws/issues/10851
- cdk - https://github.com/aws/aws-cdk/issues/5455
- cw - https://github.com/lucagrulla/cw/issues/119
- awsbw - https://github.com/jgolob/awsbw
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:
- https://github.com/benkehoe/aws-sso-credential-process
- https://github.com/flyinprogrammer/aws-sso-fetcher
- https://gist.github.com/sgtoj/af0ed637b1cc7e869b21a62ef56af5ac
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
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
File details
Details for the file yawsso-0.2.0.tar.gz
.
File metadata
- Download URL: yawsso-0.2.0.tar.gz
- Upload date:
- Size: 5.2 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
Algorithm | Hash digest | |
---|---|---|
SHA256 | 8f55ce8212984dcb23740be638f36304d6ae44231ad3e2177225ddf89574f77f |
|
MD5 | 967d8dc208b11a4ae422d27033f8e90d |
|
BLAKE2b-256 | aa27634636d5562514e70c3889d5984ab9474038418d8e770488afd214b5a789 |
File details
Details for the file yawsso-0.2.0-py3-none-any.whl
.
File metadata
- Download URL: yawsso-0.2.0-py3-none-any.whl
- Upload date:
- Size: 6.2 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
Algorithm | Hash digest | |
---|---|---|
SHA256 | bccaa6ee7e133a70c0266bb9252c3bc28555d07fb2801e4abcfb9179c264c762 |
|
MD5 | 940cf28a6f7fc08dc5fc85436969a050 |
|
BLAKE2b-256 | 6d172ed6c6b75de3e7f1720ae9e77d46eb43ab33a7d6567f202063f2b7c653b6 |