This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# WHAT IS IT? | |
# | |
# After logging into an AWS organization that is SSO enabled using CLI v2, session credentials will be | |
# cached at $HOME/.aws/sso/cache. Most AWS tools do not know how to integrate directly with AWS SSO. This | |
# small function for Bash and Zsh gives you a quick shortcut to get temporary STS credentials | |
# and exports them as environment variables which your tools are likely to understand. Primary use case | |
# I wrote this for is using the Docker AWS ECR credential helper. I often toggle between different AWS | |
# organizations, and this function understands looking through the token cache for the correct one based | |
# the SSO start URL. | |
# |