Skip to main content

An awscli plugin to authenticate and retrive AWS temporary credentials using a MFA device

Project description

AWS MFA Plugin

An awscli plugin to authenticate and retrive AWS temporary credentials using a MFA device.

Installation

This plugin was published in pypi.org. So the installation can be done using pip.

$ pip3 install --user aws-mfa-plugin

NOTE: We recommend installing inside user-site

Configure the plugin

If you are using awscli v1 configuring plugin is pretty simple.

$ aws configure set plugins.mfa aws-mfa

Otherwise, If you are using awscli v2, there is a need for additional config. see for more details.

$ aws configure set plugins.cli_legacy_plugin_path $(python3 -m site --user-site)

Assumed the plugin installed inside user-site

Verify plugin installation

If you configure correctly the plugin will become a subcommand of aws command.

$ aws mfa

Getting Started

Before using this plugin to retrieve temporary credentials you need to configure mfa_serial device.

$ aws configure set mfa_serial <your-mfa-serial-device>

To retrive temporary credentials

$ aws mfa cred-env
MFA Token for (arn:aws:iam::1234567890:mfa/username): 123456
export AWS_ACCESS_KEY_ID=<access-key-id>
export AWS_SECRET_ACCESS_KEY=<access-secret-key>
export AWS_SESSION_TOKEN=<token>

Or you can directly set these temporary credentials as environment variable by using eval command

$ eval $(aws mfa cred-env)
MFA Token for (arn:aws:iam::1234567890:mfa/username): 123456

License

This project licensed under MIT LICENSE, see LICENSE.

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

aws-mfa-plugin-0.0.4.tar.gz (5.3 kB view details)

Uploaded Source

Built Distribution

aws_mfa_plugin-0.0.4-py3-none-any.whl (6.8 kB view details)

Uploaded Python 3

File details

Details for the file aws-mfa-plugin-0.0.4.tar.gz.

File metadata

  • Download URL: aws-mfa-plugin-0.0.4.tar.gz
  • Upload date:
  • Size: 5.3 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.4.1 importlib_metadata/4.6.1 pkginfo/1.7.0 requests/2.25.1 requests-toolbelt/0.9.1 tqdm/4.61.2 CPython/3.9.6

File hashes

Hashes for aws-mfa-plugin-0.0.4.tar.gz
Algorithm Hash digest
SHA256 4484b12be78191fca6f18c94924b14bdc324b16cc439fdfbb90e6a237bd8f565
MD5 a622ccd9f197b46d45c700a02c58b860
BLAKE2b-256 1433f3e081ea7c342eddfb2d304135a19749d8100787ba4647d549b0bb1ae919

See more details on using hashes here.

File details

Details for the file aws_mfa_plugin-0.0.4-py3-none-any.whl.

File metadata

  • Download URL: aws_mfa_plugin-0.0.4-py3-none-any.whl
  • Upload date:
  • Size: 6.8 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.4.1 importlib_metadata/4.6.1 pkginfo/1.7.0 requests/2.25.1 requests-toolbelt/0.9.1 tqdm/4.61.2 CPython/3.9.6

File hashes

Hashes for aws_mfa_plugin-0.0.4-py3-none-any.whl
Algorithm Hash digest
SHA256 a67e219b178e2349ad19811a7e6968191f2e25f8ba59b4e8a69c0a33f80f2d5f
MD5 d99e339cbaaf31f61feece8f6d739882
BLAKE2b-256 0c293453a7307f12370dcaa3c54246df0055f87eed02b57cd17a75b8cd0a83cf

See more details on using hashes here.

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page