Skip to main content

Manage AWS session credentials

Project description

This python package provides a method for mfa-authenticated API access to AWS resources.

This tool is just one part of a larger setup that forces programmatic requests to the AWS API to be authenticated with multi-factor authentication. For details on how to configure IAM to forbid non-mfa-authenticated access to AWS resources, consult this AWS guide.

CLI Tool Setup

To install the aws-session-credentials CLI tool, simply install this package via pip:

pip install git+ssh://
aws-session-credentials --help

This package is both Python2 and Python3 compliant and can be safely used in either environment.

An independent executable is also available on the GitHub releases page.

For details and examples on invoking the CLI tool, run aws-session-credentials --help.


This repository is structured as a python package. When working on this project, it is recommended to install the package in development mode:

git clone
pip install -e .

Running tests

Tests can be run with:

python -m unittest discover

Release tests are run against both a Python2 and Python3 environment, so it is recommended to locally test changes using both editions of Python.

Building pex executables

The pex project can be used to build an executable file for the CLI tool:

pip install pex
pex . -m aws_session_credentials -o aws-session-credentials

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-session-credentials-0.1.3.tar.gz (5.6 kB view hashes)

Uploaded source

Built Distribution

Supported by

AWS AWS Cloud computing Datadog Datadog Monitoring Facebook / Instagram Facebook / Instagram PSF Sponsor Fastly Fastly CDN Google Google Object Storage and Download Analytics Huawei Huawei PSF Sponsor Microsoft Microsoft PSF Sponsor NVIDIA NVIDIA PSF Sponsor Pingdom Pingdom Monitoring Salesforce Salesforce PSF Sponsor Sentry Sentry Error logging StatusPage StatusPage Status page