Skip to content

Support longer AssumeRole credential duration

Choose a tag to compare

@mmmorris1975 mmmorris1975 released this 30 Mar 01:15
· 683 commits to master since this release

AWS has updated their API to allow Assume Role credentials to last up to 12 hours. This release updates the program to support setting that via the -a flag, with a default setting of 1 hour. Setting this value higher than 1 hour requires the role being assume to be configured to support a longer credential lifetime. If you see an error similar to:

Error doing AssumeRole: ValidationError: The requested DurationSeconds exceeds the MaxSessionDuration set for this role.

That means the role does not support the requested lifetime. Either due to the role not supporting the extended duration at all (still defaulting to 1 hour), or the duration is set to something lower than what is being requested.

Additionally, the environment variables AWS_REGION and AWS_PROFILE are now being set based on values found in the config file, or provided profile name, in order to allow requests to target the correct region.