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.
Do I need it?
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 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 asdev
andprod
, 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 usedefault
profile if no additional arguments pass. The main use case is for those who usedefault
profile, and would like to PIPE like thisaws sso login && yawsso -e | pbcopy
. Otherwise for named profile, doyawsso -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
subcommandlogin
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
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.5.0.tar.gz
.
File metadata
- Download URL: yawsso-0.5.0.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
Algorithm | Hash digest | |
---|---|---|
SHA256 | d3c5eb88ed327ce2ae1b836a3252836b828ddab73a4a76c2bb1d72d7c2ac9547 |
|
MD5 | 73ed7e813f9a6250964c67dc855f45b6 |
|
BLAKE2b-256 | a9d66d46fbce7b75553fe3b7a21b5bb378ca03de472466afcfde18984d2fec0b |
File details
Details for the file yawsso-0.5.0-py3-none-any.whl
.
File metadata
- Download URL: yawsso-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.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
Algorithm | Hash digest | |
---|---|---|
SHA256 | 661f939605c55be95ebbdd90fa28b3083fda9dbd49be85ed98f1ebd55d6136a2 |
|
MD5 | 3ce122d308cb1bb986130e50c715e081 |
|
BLAKE2b-256 | b5f25b51e625848c16b6f8bf4981a8dc60c7ab7457970e39bcee28fc6c38067e |