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 pip
> python -m pip install aws-sts-get-mfa-profile
- Run the script
get-sts-token.py
using the required length of token in seconds (don't do more than 1 day == 86400 seconds)
> get-sts-token.py
- 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 Distribution
Built Distribution
Close
Hashes for aws-sts-get-mfa-profile-1.1.3.tar.gz
Algorithm | Hash digest | |
---|---|---|
SHA256 | e51c0cbb216fca03df4d7cd7884ec873ca00d03c082cc2c944db8488ace4c5e5 |
|
MD5 | 9b59e97ea60052a3b01477521a51d195 |
|
BLAKE2b-256 | 10aca6f72fbedba1e9a5dea40d93d1ab6b7710417c3e76d568b97c0e21d597ca |
Close
Hashes for aws_sts_get_mfa_profile-1.1.3-py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 6f99110c49f414d90e599c78086ac5d0393b1210e1de9295af6ab5a9bf9c47e1 |
|
MD5 | 2439fd466204c860d3c82c86753a877d |
|
BLAKE2b-256 | e7c205bb7f44c5c1b6eeb57e9fb80e1e407b7cca01db0197ddfc5861b77c901f |