This tool is a simple interface that handles the CLI authentication with Amazon Web Services using the Multi-Factor-Authentication (MFA).
The tool requires the AWS CLI and JQ tool.
brew tap pabloviquez/aws-authenticator
brew install aws-authenticator
wget https://github.com/pabloviquez/aws-authenticator/archive/v1.1.0.tar.gz
tar -xzvf v1.1.0.tar.gz
chmod +x v1.1.0/aws-authenticator
sudo cp v1.1.0/aws-authenticator /usr/local/bin
rm -Rf v1.1.0
aws-authenticator
aws-authenticator -f -p MYAWSPROFILE
After running the tool, you need to load the variables as follows:
source ~/.aws/mfa-session
The supported options are:
Options:
-h Help, displays this message.
-v Verbose display.
-a ACCOUNT_ID Sets a different AWS account ID, also resets the MFA ARN serial.
-p PROFILE Uses the given profile for authentication. If not provided, will use the default.
-f Forces re-authentication.
-s Display all default values and variables loaded in environment.
-r Resets the AWS session values and deletes the ARN configured forcing to prompt
the username on the next authentication.
- Load variables in the shell automatically after executing the tool.
- Be able to use different AWS config locations.