get-aws-profile-bash
get-aws-profile-bash copied to clipboard
Add support for session expiration
Thank you for the contribution @tomisaacson. Is aws_session_expiration
/ AWS_SESSION_EXPIRATION
a supported setting or environment variable? I couldn't spot it is the AWS documentation?
https://docs.aws.amazon.com/cli/latest/userguide/cli-configure-files.html#cli-configure-files-global https://docs.aws.amazon.com/cli/latest/userguide/cli-configure-envvars.html
I didn't notice that. It's definitely used in a bunch of tools (https://www.google.com/search?q="aws_session_expiration"), I just assumed it was.
Yeah I found a few examples where an environment variable was used, but not where stored in the credentials
file. Sometimes the environment variables had different names and value formats, e.g. I saw AWS_SESSION_EXPIRES
, AWS_SESSION_EXPIRATION
, AWS_SESSION_EXPIRATION_UNIX
. Seems like something tools set after running assume-role
to remember the duration in order to renew early.
This feature is now part of PR #10. Pending documentation and testing it will get merged there.
@tomisaacson does #10 also meet your needs?