A library to setup an AWS CLI profile for an account with MFA enabled
Project description
AWS STS Get MFA Profile
Use this package to automatically setup an MFA enabled profile for AWS CLI
- Install AWS CLI
- Sign up for MFA in the AWS IAM Management console (if you haven't already) and note the MFA ARN.
- Create an access key in the AWS IAM Management console (if you haven't already) and note the access key id and secret.
- Create a credential text file profile in your home directory (
'C:\Users\SamuelMercer\.aws\credentials'
) with a default profile like below
[default]
aws_access_key_id = AKIAWZ...
aws_secret_access_key = XzRI...
mfa_serial = arn:aws:iam::467792...:mfa/...
- Install the python package using the latest
tar.gz
file in the dist folder using pip
> python -m pip install dist/aws-sts-get-mfa-profile-1.1.0.tar.gz
-
Run the script
get-sts-token.py
using the required length of token in seconds (don't do more than 1 day == 86400 seconds) -
When making AWS CLI calls from now on, use the
--profile mfa
flag and it should work, e.g.
> aws iam list-users --profile mfa
{
"Users": [
{
...
Project details
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distributions
No source distribution files available for this release.See tutorial on generating distribution archives.
Built Distribution
Close
Hashes for aws_sts_get_mfa_profile-1.1.2-py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | b495cb5988929b463b3cbab1f175d208d364750e041c1569470028a9befa38ba |
|
MD5 | d929f3fad89be2eb3142aaff05eef164 |
|
BLAKE2b-256 | 584204475ac37157153f2d7c077c675334216cc8d9dca063b4c4163b20bb22d2 |