Skip to content

cacheira/aws-cli-mfa

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

8 Commits
 
 
 
 
 
 
 
 

Repository files navigation

aws-cli-mfa

A tool to quickly get and set your MFA token, to make using the CLI easier.

Quick start

Clone this repository, open a terminal and run:

./AWS-CLI-MFA.py 000000

where 000000 is the token generated by yout MFA device.

Options

usage: AWS-CLI-MFA.py [-h] [--profile PROFILE] [--arn ARN]
                      [--credential-path CREDENTIAL_PATH]
                      [--duration DURATION]
                      token

Update your AWS CLI Token

positional arguments:
  token                 token from your MFA device

optional arguments:
  -h, --help            show this help message and exit
  --profile PROFILE     AWS profile to store the session token. If unset,
                        ENV(AWS_PROFILE) or first profile in "~/.aws/config"
                        will be used.
  --arn ARN             AWS ARN from the IAM console (Security credentials ->
                        Assigned MFA device). This is saved to your
                        .aws/credentials file
  --credential-path CREDENTIAL_PATH
                        path to the aws credentials file
  --duration DURATION   The duration, in seconds, that the credentials should
                        remain valid.

Config file

If you do not want to input your MFA device's arn, you can configure it in ./aws/config

[default]
(...)
mfa_serial = arn:aws:iam::123456789123:mfa/my_iam_user

About

A tool to quickly get and set your MFA token, to make using the CLI easier.

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages