| Crates.io | aws-assume-role |
| lib.rs | aws-assume-role |
| version | 1.3.1 |
| created_at | 2025-06-20 12:40:14.109422+00 |
| updated_at | 2025-06-24 02:40:05.678313+00 |
| description | Simple CLI tool to easily switch between AWS IAM roles across different accounts |
| homepage | https://github.com/holdennguyen/aws-assume-role |
| repository | https://github.com/holdennguyen/aws-assume-role |
| max_upload_size | |
| id | 1719564 |
| size | 256,502 |
A fast, reliable command-line tool for switching between AWS IAM roles across different accounts. Built for modern development workflows with comprehensive multi-platform support.
Choose your preferred method:
# ๐บ Homebrew (macOS/Linux) - Recommended
brew tap holdennguyen/tap && brew install aws-assume-role
# ๐ฆ Cargo (Rust users)
cargo install aws-assume-role
# ๐ฆ Direct download (any platform)
curl -L https://github.com/holdennguyen/aws-assume-role/releases/download/v1.3.0/aws-assume-role-cli-v1.3.0.zip -o aws-assume-role-cli-v1.3.0.zip
unzip aws-assume-role-cli-v1.3.0.zip && cd aws-assume-role-cli-v1.3.0
./INSTALL.sh
๐ Need help with installation? โ Complete Installation Guide
# 1. Configure your first role
awsr configure --name dev --role-arn arn:aws:iam::123456789012:role/DevRole --account-id 123456789012
# 2. Verify it worked by checking your AWS identity
aws sts get-caller-identity
| Command | Purpose | Example |
|---|---|---|
awsr configure |
Add or update a role configuration | awsr configure --name prod |
awsr assume |
Assume a configured role and export credentials | awsr assume dev --duration 7200 |
awsr list |
Show all configured roles | awsr list |
awsr remove |
Delete a role configuration | awsr remove dev |
Make role switching even faster with aliases:
# Add to ~/.bashrc, ~/.zshrc, or your shell config
alias assume-dev='awsr assume dev'
alias assume-prod='awsr assume prod'
alias aws-whoami='aws sts get-caller-identity --query "Arn" --output text'
# Usage
assume-dev # Switch to dev role
aws-whoami # Check current identity
| Document | Purpose | Target Audience |
|---|---|---|
| ๐ Installation & Deployment | Complete installation guide, prerequisites, enterprise deployment | End Users, DevOps Teams |
| ๐จโ๐ป Development Guide | Development setup, testing, contributing, release workflow | Contributors, Maintainers |
| ๐๏ธ Technical Architecture | System design, security architecture, technical deep-dive | Technical Users, Architects |
| ๐ Release Notes | Version history, changelog, migration guides | All Users |
~/.aws-assume-role/config.jsonExample configuration:
{
"roles": {
"dev": {
"role_arn": "arn:aws:iam::123456789012:role/DevRole",
"account_id": "123456789012",
"region": "us-east-1"
},
"prod": {
"role_arn": "arn:aws:iam::987654321098:role/ProdRole",
"account_id": "987654321098",
"region": "us-west-2"
}
},
"default_duration": 3600,
"default_region": "us-east-1"
}
aws-lc-rs backend| Platform | Status | Installation Command |
|---|---|---|
| ๐ฆ Cargo | โ Live | cargo install aws-assume-role |
| ๐บ Homebrew | โ Live | brew tap holdennguyen/tap && brew install aws-assume-role |
| ๐ณ Container | โ Live | docker pull ghcr.io/holdennguyen/aws-assume-role:latest |
| ๐ Direct Download | โ Live | GitHub Releases |
cargo test)# Complex, error-prone, hard to remember
aws sts assume-role \
--role-arn "arn:aws:iam::123456789012:role/DevRole" \
--role-session-name "my-session-$(date +%s)" \
--duration-seconds 3600 \
--query 'Credentials.[AccessKeyId,SecretAccessKey,SessionToken]' \
--output text | while read access_key secret_key session_token; do
export AWS_ACCESS_KEY_ID="$access_key"
export AWS_SECRET_ACCESS_KEY="$secret_key"
export AWS_SESSION_TOKEN="$session_token"
done
# Simple, reliable, memorable
awsr assume dev
๐ Result: 10x faster role switching, zero errors, works everywhere!
We welcome contributions! Here's how to get started:
cargo test (all 60 tests must pass)Quick development setup:
git clone https://github.com/holdennguyen/aws-assume-role.git
cd aws-assume-role
./dev-cli.sh check # Run all quality checks
./target/release/aws-assume-role --help
This project is licensed under the GNU AGPLv3 - see the LICENSE file for details.
Built with the modern Rust ecosystem and AWS SDK v1.x for reliable, secure AWS credential management. Special thanks to the AWS CLI team for providing the foundation this tool builds upon.
๐ก Need Help?