Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Setting duration_seconds in AWS config file causes TypeError #88

andrewmackett opened this issue Feb 4, 2020 · 1 comment


Copy link

@andrewmackett andrewmackett commented Feb 4, 2020

When using awsume==4.1.9 I'm able to set duration_seconds in my ~/.aws/config file to assume a role for longer than the default 1 hour.

All newer versions of awsume now produce a TypeError when duration_seconds is set.

Traceback (most recent call last):
  File "/Users/andrewmackett/.pyenv/versions/3.7.4/bin/awsumepy", line 12, in <module>
  File "/Users/andrewmackett/.pyenv/versions/3.7.4/lib/python3.7/site-packages/awsume/awsumepy/", line 29, in main
  File "/Users/andrewmackett/.pyenv/versions/3.7.4/lib/python3.7/site-packages/awsume/awsumepy/", line 17, in run_awsume
  File "/Users/andrewmackett/.pyenv/versions/3.7.4/lib/python3.7/site-packages/awsume/awsumepy/", line 246, in run
    credentials = self.get_credentials(args, profiles)
  File "/Users/andrewmackett/.pyenv/versions/3.7.4/lib/python3.7/site-packages/awsume/awsumepy/", line 201, in get_credentials
    credentials = self.plugin_manager.hook.get_credentials(config=self.config, arguments=args, profiles=profiles)
  File "/Users/andrewmackett/.pyenv/versions/3.7.4/lib/python3.7/site-packages/pluggy/", line 286, in __call__
    return self._hookexec(self, self.get_hookimpls(), kwargs)
  File "/Users/andrewmackett/.pyenv/versions/3.7.4/lib/python3.7/site-packages/pluggy/", line 92, in _hookexec
    return self._inner_hookexec(hook, methods, kwargs)
  File "/Users/andrewmackett/.pyenv/versions/3.7.4/lib/python3.7/site-packages/pluggy/", line 86, in <lambda>
    firstresult=hook.spec.opts.get("firstresult") if hook.spec else False,
  File "/Users/andrewmackett/.pyenv/versions/3.7.4/lib/python3.7/site-packages/pluggy/", line 208, in _multicall
    return outcome.get_result()
  File "/Users/andrewmackett/.pyenv/versions/3.7.4/lib/python3.7/site-packages/pluggy/", line 80, in get_result
    raise ex[1].with_traceback(ex[2])
  File "/Users/andrewmackett/.pyenv/versions/3.7.4/lib/python3.7/site-packages/pluggy/", line 187, in _multicall
    res = hook_impl.function(*args)
  File "/Users/andrewmackett/.pyenv/versions/3.7.4/lib/python3.7/site-packages/awsume/awsumepy/", line 472, in get_credentials
    if role_duration > 3600: # cannot use temp creds with custom role duration more than an hour
TypeError: '>' not supported between instances of 'str' and 'int'

Example config file:

[profile andrew]
region = eu-west-1
output = json
mfa_serial = arn:aws:iam:: 111111111111:mfa/andrew.mackett

[profile dev]
source_profile = andrew
role_arn = arn:aws:iam::222222222222:role/admin
duration_seconds = 10800
Copy link

@mbarneyjr mbarneyjr commented Feb 4, 2020


Thanks for bringing this to our attention, a fix has been pushed to 4.2.1


Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
None yet
None yet

No branches or pull requests

2 participants