Skip to main content

AWS STS Tool

aws_sts_tool CI aws_sts_tool build PyPI

A CLI tool to help assume AWS role via STS. Useful in automated environments and cross account access requirements for workflows involving AWS.

Prerequisites

  • A AWS user/role credentials that would be used as a trust relation with the roles that need to be assumed.
  • Python >= 3.7

Installation

Run the following to install the tool using pip.

pip install aws_sts_tool

Usage

  • Assuming that you have stored user/role credentials that will be used to assume roles at the locations specified by AWS, you can run the following commands.

With default duration configured on the role to assume

aws_sts_tool account_id sessionName roleName output
  • Where the command line arguments are as follows:
    • account_id - the 12 digit AWS account.
    • sessionName - a name to identify the session with.
    • roleName - the role to be assumed.
    • output - the output format of the credentials. Must be one of json, shell or both.

Example:

aws_sts_tool 123456789012 test-session test-role json

With custom duration

aws_sts_tool account_id sessionName roleName output --duration duration
  • Where the command line arguments are as follows:
    • account_id - the 12 digit AWS account.
    • sessionName - a name to identify the session with.
    • roleName - the role to be assumed.
    • output - the output format of the credentials. Must be one of json, shell or both.
    • duration - the custom duration in seconds to assume the role.

Example:

# Will fetch credentials valid for 2 hours
aws_sts_tool 123456789012 test-session test-role json --duration 7200
  • Once the command executes successfully, it will store the credentials for the role assumed in credentials.{ json | sh } at the location from where the command is executed.

License

MIT License

Metadata

Release files for aws-sts-tool 1.0.3

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

Source distribution (sdist)

Source distribution for aws-sts-tool 1.0.3
File Size Uploaded Provenance
aws_sts_tool-1.0.3.tar.gz 5.1 kB Without provenance Details

Built distribution (wheel)

Table of built distributions (wheels) for aws-sts-tool 1.0.3
File Interpreter ABI Platform
aws_sts_tool-1.0.3-py3-none-any.whl Python 3 none any Details

Total release size: 11.2 kB

Release files / aws_sts_tool-1.0.3.tar.gz

Download URL aws_sts_tool-1.0.3.tar.gz
Size 5.1 kB
Tags Source
SHA-256 checksum
How to use checksums
97eb15d0f96145cf9cb88099162652218d422e4c4f28b02dc17b1d0f0026b763
BLAKE2b-256 checksum
How to use checksums
60134fdc3be75ef12ba2860be7b4a953181dea048791912a33e813929d491823
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/4.0.1 CPython/3.9.13

Release files / aws_sts_tool-1.0.3-py3-none-any.whl

Download URL aws_sts_tool-1.0.3-py3-none-any.whl
Size 6.1 kB
Tags Python 3
SHA-256 checksum
How to use checksums
15d33340eb6ceadb3d38e5059878c21bbb96eb51df597edda50f6cb4332c85cc
BLAKE2b-256 checksum
How to use checksums
3a9f0e8bcbb6a402519da2827e50f73f8e752c46bc74d0feacd9d98dea217a2c
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/4.0.1 CPython/3.9.13

Security for aws-sts-tool 1.0.3

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.

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