trek10inc / awsume

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

awsume fails to export the SessionToken value to the shell environment #46

Closed paulbrice closed 5 years ago

paulbrice commented 5 years ago

I am running 'awsume' using a shared credentials file. The config file contains profiles using a source profile in the credentials file. The source profile contains both key attributes as well as a session token as its created from a federated credential. I never have credentials stored in [default].

Issue: The session token is never exported to the shell environment.

Example: config file

[default]
region = us-east-1

[profile internal-admin]
role_arn = arn:aws:iam::<your aws account id>:role/admin-role
source_profile = joel
region = us-east-1

Example: credentials file

[default]

[joel]
aws_access_key_id = AKIAIOSFODNN7EXAMPLE
aws_secret_access_key = wJalrXUtnFEMI/K7MDENG/bPxRfiCYEXAMPLEKEY
aws_session_token     = FQoGZXIvYXdzEK3//////////w==

OS: Mac High Sierra Shell: bash / zsh

tehmaspc commented 5 years ago

Seeing same thing here. Same DEV environment. :(

UPDATE:

My issue turned out to be with the missing alias - but since my install includes pyenv I needed to do the following:

alias awsume='. $(pyenv which awsume)'

I found this important info here: https://github.com/trek10inc/awsume/wiki/Changelog#327---2018-4-27---bug-fixes

Wish it was called out on the main README.md

mewelling commented 5 years ago

@tehmaspc Thanks so much - that got it working for me too!

mbarneyjr commented 5 years ago

56 added this functionality, a new version coming soon, closing

Thanks for the feature request!