trek10inc / awsume

A utility for easily assuming AWS IAM roles from the command line.
https://awsu.me
MIT License
487 stars 90 forks source link

Return suitable exit codes on errors #142

Closed YektaLeblebici closed 3 years ago

YektaLeblebici commented 3 years ago

On errors such as:

Awsume error: Profile dsfsdfds not found.
Awsume error: An error occurred (AccessDenied) when calling the GetSessionToken operation: MultiFactorAuthentication failed with invalid MFA one time pass code.

Awsume exits with exit code 0, which signals success.

One use-case for awsume is to use it in a wrapper for other tools, and in that case it'd be good to be able to exit early on if the profile couldn't be used. If awsume returns a non-zero exit code on errors, other tooling can simply check for this and act accordingly.

Thanks for this awsume tool! :)

mbarneyjr commented 3 years ago

Thanks for the bug report! We've released 4.5.1 which should resolve these issues, if you're still hitting them, please feel free to reopen or open a new issue!

Also note, I've experienced issues where pip install --upgrade and pipx upgrade (depending on how you installed awsume) don't actually update the shell scripts, so if you're still experiencing issues, one thing I've done to ensure the shell scripts are updated is to uninstall and then reinstall awsume