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

Closed
andrewmackett opened this issue Feb 4, 2020 · 1 comment
Closed

Comments

@andrewmackett
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>
    sys.exit(main())
  File "/Users/andrewmackett/.pyenv/versions/3.7.4/lib/python3.7/site-packages/awsume/awsumepy/main.py", line 29, in main
    run_awsume(sys.argv[1:])
  File "/Users/andrewmackett/.pyenv/versions/3.7.4/lib/python3.7/site-packages/awsume/awsumepy/main.py", line 17, in run_awsume
    awsume.run(argument_list)
  File "/Users/andrewmackett/.pyenv/versions/3.7.4/lib/python3.7/site-packages/awsume/awsumepy/app.py", 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/app.py", 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/hooks.py", 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/manager.py", 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/manager.py", 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/callers.py", line 208, in _multicall
    return outcome.get_result()
  File "/Users/andrewmackett/.pyenv/versions/3.7.4/lib/python3.7/site-packages/pluggy/callers.py", 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/callers.py", line 187, in _multicall
    res = hook_impl.function(*args)
  File "/Users/andrewmackett/.pyenv/versions/3.7.4/lib/python3.7/site-packages/awsume/awsumepy/default_plugins.py", 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
@mbarneyjr
Copy link
Member

@mbarneyjr mbarneyjr commented Feb 4, 2020

Howdy,

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

Thanks!

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

No branches or pull requests

2 participants