Skip to content
This repository has been archived by the owner on Sep 17, 2024. It is now read-only.

linkbal/easy-role-selector-for-assume-role-in-aws-cli

 
 

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

5 Commits
 
 
 
 

Repository files navigation

Easy role selector for AWS assume-role

If you have multile roles in multiple AWS accounts, it's tedius to switch between roles in AWS CLI.

This script makes it easier to select a role.

Usage

Usage:
$ assume-role 

select-a-role

Old identity
{
    "UserId": "XXXXXXXXXXXXXXXXXXXXX",
    "Account": "123456789012",
    "Arn": "arn:aws:iam::234567890123:user/[email protected]"
}
Copy and paste to Run the lines below in your shell

export AWS_ACCESS_KEY_ID=xxxxxxxxxxxxxxxxxxxx
export AWS_SECRET_ACCESS_KEY=xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx
export AWS_SESSION_TOKEN=xxxxxxxxxxxxx...(snip)...xxxxxxxxxxxxxxx

echo Current identity
aws sts get-caller-identity

Configuration file: ~/.aws/assume-role.conf

account1 arn:aws:iam::012345678901:role/xxxxxx-role
account1 arn:aws:iam::012345678901:role/yyyyyy-role
account1 arn:aws:iam::012345678901:role/zzzzzz-role
account2 arn:aws:iam::123456789012:role/abcdef-role
account3 arn:aws:iam::987654321098:role/opqrst-role

Funding

This work is partially funded by Linkbal Inc.

About

Easy assume-role on CLI

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages

  • Shell 100.0%