A plugin for Oh My Fish.
Gets and sets temporary credentials for an AWS account or IAM user when using an MFA-enabled account.
$ omf install https://github.com/davewongillies/plugin-awsmfa
In ~/.aws/credentials
, add username
and account_id
settings to each profile that you want to use awsmfa
with.
$ awsmfa Generates temporary credentials for the default aws profile
$ awsmfa [profile_name] Generates temporary credentials for the aws profile of a provided name
awsmfa
sets the env var $AWS_SESSION_EXPIRY
, so running awsmfa
again will only prompt for a token is its expired. Run the function __awsmfa_clear_variables
if you want to clear them.
$ awsmfa
AWS_SESSION_TOKEN is still valid but will expire at 2017-12-01T06:14:57Z
© David Gillies et al