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/antonwinter/plugin-awsmfaIn ~/.aws/config, ensure you have the mfa_serial in each profile that you want to use awsmfa with as per the AWS CLI Using Multi-Factor Authentication Docs.
$ awsmfa Generates temporary credentials for the default aws profile
$ awsmfa [profile_name] Generates temporary credentials for the aws profile of a provided nameawsmfa 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