Skip to main content
Pre-release

This release is a pre-release and may not be stable for production use.

AWS CLI MFA

It can help you to access AWS resources through AWS CLI with MFA token.

Preperation

  1. AWS CLI environemnt (including configurations in ~/.aws)
$ curl "https://awscli.amazonaws.com/awscli-exe-linux-x86_64.zip" -o "awscliv2.zip"
$ unzip awscliv2.zip
$ sudo ./aws/install
  1. AWS profile name should follow this rule. You need to prepare 2 profiles. One for your original IAM user ${profile}-default, and ther other is for your temporary profile, activated by MFA token. ${profile}.
# Let's assume your IAM user name is 'lol'
# ~/.aws/credentials
[lol-default]
aws_access_key_id = ...
aws_secret_access_key = ...

[lol]

Usage

argument description mandatory default
--mfa MFA token code (--token-code) Y -
--profile AWS profile you want to use (--profile) N AWS_PROFILE in your shell
--arn ARN of the MFA device (--serial-number) N .credentials' mfa_device_arn
# Your profile should be 'lol'
$ echo $AWS_PROFILE
  lol

# 1st usage: pass arn of mfa togegher
# then, credentials keep your temporary information.
$ aws-cli-mfa --mfa ${mfa-token} --arn arn:aws:iam::${account-id}:mfa/${username} 

# Further usage: only pass mfa token is enough
$ aws-cli-mfa --mfa ${mfa-token}

Metadata

Release files for aws-cli-mfa 0.1.1b0

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for aws-cli-mfa 0.1.1b0
File Size Uploaded
aws-cli-mfa-0.1.1b0.tar.gz 3.8 kB Details

Built distribution (wheel)

Table of built distributions (wheels) for aws-cli-mfa 0.1.1b0
File Interpreter ABI Platform
aws_cli_mfa-0.1.1b0-py3-none-any.whl Python 3 none any Details

Total release size: 9.2 kB

Release files / aws-cli-mfa-0.1.1b0.tar.gz

Download URL aws-cli-mfa-0.1.1b0.tar.gz
Size 3.8 kB
Tags Source
SHA-256 checksum
How to use checksums
58fd25a4a7a659cdeb80a12a797df4f5e1ee3f12b2a32b3eae595b95e480169e
BLAKE2b-256 checksum
How to use checksums
37394affce7596f08347195a4fdbdf42cb98d370d1883563feafb2397a7742fc
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/3.3.0 pkginfo/1.6.1 requests/2.24.0 setuptools/50.3.1.post20201107 requests-toolbelt/0.9.1 tqdm/4.50.2 CPython/3.8.5

Release files / aws_cli_mfa-0.1.1b0-py3-none-any.whl

Download URL aws_cli_mfa-0.1.1b0-py3-none-any.whl
Size 5.3 kB
Tags Python 3
SHA-256 checksum
How to use checksums
ce69d8d93e92b5837c532d9a86e2f8f29587feab1cdbc026e85f02a7fa09c38a
BLAKE2b-256 checksum
How to use checksums
dab8617617424328546e418290ba55a48fa0cf296251b2bf0db3d8b50f429d3f
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/3.3.0 pkginfo/1.6.1 requests/2.24.0 setuptools/50.3.1.post20201107 requests-toolbelt/0.9.1 tqdm/4.50.2 CPython/3.8.5

Release history Release notifications | RSS feed

This release

0.1.1b0 This release

2 release files

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page