Last active
November 9, 2020 07:04
-
-
Save RichardBronosky/e3eba29ebb9caabc556631fe8d0056b4 to your computer and use it in GitHub Desktop.
Convert the output of `aws sts get-session-token` to shell export statements
This file contains 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
#!/usr/bin/env python | |
import json, re, sys | |
for k,v in json.load(sys.stdin)['Credentials'].items(): print("export AWS{}='{}'".format(re.sub('([A-Z])', r'_\1', k).upper(),v)) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment