It can help you to access AWS resources through AWS CLI with MFA token
Project description
AWS CLI MFA
It can help you to access AWS resources through AWS CLI with MFA token.
Preperation
- 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
- 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}
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
aws-cli-mfa-0.1.1b0.tar.gz
(3.8 kB
view details)
Built Distribution
File details
Details for the file aws-cli-mfa-0.1.1b0.tar.gz
.
File metadata
- Download URL: aws-cli-mfa-0.1.1b0.tar.gz
- Upload date:
- Size: 3.8 kB
- Tags: Source
- Uploaded using 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
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 58fd25a4a7a659cdeb80a12a797df4f5e1ee3f12b2a32b3eae595b95e480169e |
|
MD5 | 24463cb179435894bf1c0dc0b6aa34b1 |
|
BLAKE2b-256 | 37394affce7596f08347195a4fdbdf42cb98d370d1883563feafb2397a7742fc |
File details
Details for the file aws_cli_mfa-0.1.1b0-py3-none-any.whl
.
File metadata
- Download URL: aws_cli_mfa-0.1.1b0-py3-none-any.whl
- Upload date:
- Size: 5.3 kB
- Tags: Python 3
- Uploaded using 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
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | ce69d8d93e92b5837c532d9a86e2f8f29587feab1cdbc026e85f02a7fa09c38a |
|
MD5 | 721a1eee8f5242d2456a6055f0148c9e |
|
BLAKE2b-256 | dab8617617424328546e418290ba55a48fa0cf296251b2bf0db3d8b50f429d3f |