Skip to content

awscli now asks for token code when used with MFA enabled IAM accounts.

License

Notifications You must be signed in to change notification settings

seporaitis/awscli-plugin-credential-mfa

Repository files navigation

awscli-plugin-credential-mfa

Automatically asks for MFA token key to retrieve temporary credentials.

Installation and Usage

Install the plugin:

pip install awscli-plugin-credential-mfa

Enable the plugin:

aws configure set plugins.credentials awscli_plugin_credential_mfa

Assuming your IAM user has MFA enabled and credentials set up, you also need to set mfa_serial and source_profile in the configuration. Below are instructions for profile default, adjust as appropriate

[default]
mfa_serial = arn:aws:iam::123456789012:mfa/iam-user-name
source_profile = default