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

Unset variable feature #21

Closed holybit closed 6 years ago

holybit commented 6 years ago

A common issue I have is I need to unset all existing shell environment variables that a previous run of . awsume -s PROFILE set.

Woud be nice if you could run awsume -u and it would dump something such as:

$ awsume -u
unset AWS_SECRET_ACCESS_KEY
unset AWS_ACCESS_KEY_ID
etc...
mbarneyjr commented 6 years ago

If you execute awsume -k, which normally is used to stop awsume role auto-refresher, it will unset all environment variables that awsume sets.

This feature hasn't been documented, but I will be sure to document it in the usage description in the next release.

holybit commented 6 years ago

I would like to request this issue be re-opened @mbarneyjr.

First, the docs still don't say that awsume -k will unset all env vars. Secondly, it's not good CLI arg form to have a single command do two things at once. I would say add a -u flag for unset.

$ awsume -v
3.2.5
$ awsume -h
...
  -k, --kill-refreshing                       Kill autoawsume
...
mbarneyjr commented 6 years ago

AWSume 3.2.8 is released and now includes a dedicated "environment variable unset" feature; check out the changelog for more details on this update

Thanks for the request!