Skip to main content

Simple CLI for AWS SSO credential management across multiple accounts and roles

Project description

aws-assume

CI PyPI License: MIT

Simple CLI for AWS SSO credential management across multiple accounts and roles.

Installation

pip install aws-assume-cli

Usage

# Eval into your shell (most common usage)
eval $(aws-assume my-profile)

# List available profiles
aws-assume --list

# Output as JSON
aws-assume my-profile --json

# Write to a Docker .env file
aws-assume my-profile --env-file .env

# Write to ~/.aws/credentials
aws-assume my-profile --credentials

# Write credentials under a specific profile name
aws-assume my-profile --credentials --credentials-profile temp-dev

# Set session duration (for role assumption)
aws-assume my-profile --duration 3600

# Skip automatic SSO login prompt
aws-assume my-profile --no-auto-login

How it works

aws-assume reads your ~/.aws/config and supports three profile types:

SSO profiles — logs you in via aws sso login if the session is expired, then fetches temporary credentials.

[profile my-sso]
sso_start_url = https://my-org.awsapps.com/start
sso_region = us-east-1
sso_account_id = 123456789012
sso_role_name = AdministratorAccess
region = us-east-1

Role assumption profiles — assumes a role using another profile as the source.

[profile prod-admin]
role_arn = arn:aws:iam::999999999999:role/AdminRole
source_profile = my-sso
region = us-east-1

SSO + role chaining — the source profile itself uses SSO. aws-assume handles the chain automatically.

Output modes

Flag Output Use case
(default) export VAR=... eval $(aws-assume profile) in shell
--json JSON object Scripting, piping
--env-file PATH Docker .env format docker run --env-file .env ...
--credentials ~/.aws/credentials SDK / tool compatibility

Development

git clone https://github.com/Specter099/aws-assume-cli
cd aws-assume-cli
python -m venv .venv && source .venv/bin/activate
pip install -e ".[dev]"
pytest

License

MIT

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_assume_cli-0.1.1.tar.gz (10.5 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

aws_assume_cli-0.1.1-py3-none-any.whl (8.9 kB view details)

Uploaded Python 3

File details

Details for the file aws_assume_cli-0.1.1.tar.gz.

File metadata

  • Download URL: aws_assume_cli-0.1.1.tar.gz
  • Upload date:
  • Size: 10.5 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.7

File hashes

Hashes for aws_assume_cli-0.1.1.tar.gz
Algorithm Hash digest
SHA256 05de387e1b1862246de152313a250ed02a9dc66cffd639b3062821b8eb23ac84
MD5 0db3ed476564db8cdc0d32c52edb3aeb
BLAKE2b-256 379233826d6e4861a464c84ccc75297a039d079113c6902b7d38fe4cc4c39a2e

See more details on using hashes here.

Provenance

The following attestation bundles were made for aws_assume_cli-0.1.1.tar.gz:

Publisher: publish.yml on Specter099/aws-assume-cli

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file aws_assume_cli-0.1.1-py3-none-any.whl.

File metadata

  • Download URL: aws_assume_cli-0.1.1-py3-none-any.whl
  • Upload date:
  • Size: 8.9 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.7

File hashes

Hashes for aws_assume_cli-0.1.1-py3-none-any.whl
Algorithm Hash digest
SHA256 48fb598fe080716ac678b6ea51a220a568c095d8acde4b0c93b5b7a3e546e01a
MD5 e1535b979f1162443d9e89930cdbc044
BLAKE2b-256 6c260e1cef586b8c25b0fe8663022be61fc001a6859a6cab9ee7351a93f77df6

See more details on using hashes here.

Provenance

The following attestation bundles were made for aws_assume_cli-0.1.1-py3-none-any.whl:

Publisher: publish.yml on Specter099/aws-assume-cli

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

Supported by

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