Skip to main content

assumerole

This python package was inspired by the GO implementation of assume-role. This utility makes it easier to switch between multiple AWS profiles.

Pre-requisite

  • aws sdk should be installed
  • aws credentials are provided under ~/.aws/credentials
  • all the aws profiles are created correctly under ~/.aws/config

This utility uses sts utility within the boto3 package. You can learn more about sts command under awscli

Installation:

pip install --index-url https://test.pypi.org/simple/ assumerole For updating existing package use pip install -U --index-url https://test.pypi.org/simple/ assumerole

Usage

assume --profile <aws-profile-name> or assume -p <aws-profile-name>

You may be prompted to pass your MFA code if its required

By default, the tokens returned are cached under the folder ~/.aws/cached_tokens Only if the token has expired, will new tokens be requested from AWS. You can also find a history of all successful commands in the file ~/.aws/assume_role_history

In case you do not want to use your cached tokens use the optional refresh parameter

assume --profile <aws-profile-name> --refresh or assume -p <aws-profile-name> -r

In case you do not want to set the expirty time on the token optional duration parameter Default is 8 hours and maximum value is 12 (set by AWS)

assume --profile <aws-profile-name> --duration 10 or assume -p <aws-profile-name> -d 10

TODO:

  • Perform comprehensive coverage testing. Once package is tested fully, it will be made available in pypi.org
  • In the meantime, do test it out and feel free to submit PRs

Metadata

Release files for assumerole 0.6.2

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for assumerole 0.6.2
File Size Uploaded Provenance Actions
assumerole-0.6.2.tar.gz 4.9 kB Without provenance Details for assumerole-0.6.2.tar.gz

Built distribution (wheel)

Table of built distributions (wheels) for assumerole 0.6.2
File Interpreter ABI Platform Actions
assumerole-0.6.2-py3-none-any.whl Python 3 none any Details for assumerole-0.6.2-py3-none-any.whl

Total release size: 10.3 kB

Release files / assumerole-0.6.2.tar.gz

Download URL assumerole-0.6.2.tar.gz
Size 4.9 kB
Tags Source
SHA-256 checksum
How to use checksums
f1566ece70cc2fa1f30ac100f87dce81f9f09e4453934cab62c0165c4e3e0a5a
BLAKE2b-256 checksum
How to use checksums
91cb838e176ff0647ccf0059fb774a376a93a44738f42da6ae7aa8cee2708bfc
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via poetry/1.1.5 CPython/3.7.6 Darwin/20.3.0

Release files / assumerole-0.6.2-py3-none-any.whl

Download URL assumerole-0.6.2-py3-none-any.whl
Size 5.4 kB
Tags Python 3
SHA-256 checksum
How to use checksums
9985824afa7c310299d5996e23f62d61d704e9b3e6da565d19662261a9e2dfde
BLAKE2b-256 checksum
How to use checksums
4861cf7c29d75280df06bd5bd0fab4fd3e09730ed6e2fd40334667b03a3d1ab2
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via poetry/1.1.5 CPython/3.7.6 Darwin/20.3.0

Security for assumerole 0.6.2

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

No provenance found

None of the files in this release were uploaded with provenance metadata.

A note on package security

PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.

To learn more about protecting yourself from malicious actors, visit our package security documentation.

Release history Release notifications | RSS feed

This release

0.6.2 This release

2 release files No provenance

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page