get-aws-profile-bash icon indicating copy to clipboard operation
get-aws-profile-bash copied to clipboard

Add support for session expiration

Open tomisaacson opened this issue 5 years ago • 4 comments

tomisaacson avatar May 03 '19 01:05 tomisaacson

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

whereisaaron avatar May 05 '19 08:05 whereisaaron

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.

tomisaacson avatar May 05 '19 08:05 tomisaacson

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.

whereisaaron avatar May 06 '19 04:05 whereisaaron

This feature is now part of PR #10. Pending documentation and testing it will get merged there.

@tomisaacson does #10 also meet your needs?

whereisaaron avatar Jul 20 '19 16:07 whereisaaron