Today I released a small script to help create an aws cli v2 config file if you’re using AWS SSO federation to access AWS. It will do a live scrape against AWS SSO to get your roles per account and make the config sections for you.
If you’re one to have lots of accounts and lots of roles this one may help you.
The read me has the instructions for the script.
Some tid bits here is that the AWS CLI V2 has a small bug relating to the time stamp being used as the expiresAt value for the sso/cached/*.json files.
This makes me unable to check timeout first so an annoying bug is that if your session has indeed timed out you will get a horrible python error first.
As usual the script assumes you have:
- installed aws cli v2
- installed python3
- installed the boto3 library for python
- set up your initial aws sso role in your cli config file
- done an aws sso login prior to using the the script as it will do a live scrape against AWS SSO.
Any issues please raise via github.com