trek10inc / awsume

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

The environment variables weren't being set properly when running awsume. #108

Closed ahadcse closed 3 years ago

ahadcse commented 4 years ago

Hi, I am trying to use awsume to assume a role, but it doesn't switch role when I input awsume . As a workaround, I have to input awsume -s and then paste the output again.

N.B: I am using Macbook Pro. I have configured my .bash_profile with alias: alias awsume='. awsume'

Can you please help me on what am I doing wrong?

bugwrangler commented 4 years ago

I had been facing same issue too, using similar workaround.

awsume --unset also doesn't work /usr/local/bin/awsume: line 71: return: can only `return' from a function or sourced script

mbarneyjr commented 4 years ago

This problem usually occurs due to the alias not being set in your active shell. If you run the alias command, do you see the correct awsume alias displayed?

bugwrangler commented 4 years ago

yep! thanks - worked after adding the alias in zsh :)

alias awsume=". awsume"

mbarneyjr commented 4 years ago

@ahadcse have you resolved the issue?

mbarneyjr commented 3 years ago

Closing, but if you're still experiencing issues feel free to re-open

ahadcse commented 3 years ago

@mbarneyjr When I run alias command I cannot see anything regarding awsume even though I have the line alias awsume=". awsume" in my .bash_profile file. I guess I was not able to set alias and the problem is not solved yet

ahadcse commented 3 years ago

@mbarneyjr Oh I have not given the command $source .bash_profile. Now it works. Thanks for helping

mbarneyjr commented 3 years ago

It might be that your shell is zsh, so it won't load your ~/.bash_profile on login. The zsh equivalent file is generally ~/.zshenv