Good news Windows users! You can now use this AWSume script on Windows. I assume I am not the only one that uses Windows for AWS work? … Right?!?
It works exactly as the Mac version. Just put the script somewhere and add the path to your PATH environment variable.
In case this is your first time hearing of AWSume, this tool was made to help make cross account access on the CLI easier. For example, I have a user ID in the AWS Trek10 account. Instead of needing to maintain separate IDs with different credentials in each customer account, I use my AWS Trek10 user ID, along with the roles we have created in our customer accounts, to gain access to each customer account. You can read more about it here.
The Solution - AWSume
I wrote a script to leverage the fact that the CLI will assume a role and cache the credentials for you. The script reads the credentials from the CLI cache and writes them into environment variables. This way the CLI will default to using them without specifying the profile and the SDKs will also pickup the creds from the environment variables. It also has an option to print the export statements to easily copy them into a VM or SSH session.