- Have AWS credentials file located in
~/.aws/credentials
- MacOS or Linux (only tested on MacOS)
- Use Google Chrome, Firefox, Safari or Brave Browser
Login to the AWS account you want to access (not your origin account), then create IAM policy like below:
{
"Version": "2012-10-17",
"Statement": [
{
"Effect": "Allow",
"Principal": {
"AWS": "arn:aws:iam::<your-origin-aws-account-id>:root"
},
"Action": "sts:AssumeRole"
}
]
}
Login to your origin account, then add IAM policy to the user you want to give permission to assume the above role like below:
{
"Version": "2012-10-17",
"Statement": [
{
"Effect": "Allow",
"Action": "sts:AssumeRole",
"Resource": "arn:aws:iam::<aws-account-id-you-want-to-access>:role/<role-name>"
}
]
}
Update .aws/credentials
file
[my-aws-profile]
aws_access_key_id = XXXX
aws_secret_access_key = XXXX
[my-role]
role_arn = arn:aws:iam::<role-account-id>:role/<role-name>
source_profile = my-aws-profile
- Download the binary
- OSX ? Download bin/osx/ars.tar.gz
- Linux ? Download bin/linux/ars.tar.gz
- Extract the file. Tip: If you're using terminal -> run
tar -xzvf ars.tar.gz
- Copy the extracted file to
usr/local/bin
. Tip: If you're using terminal -> runcp ars /usr/local/bin
$ ars --help
Usage of ars:
-ask-redirect-url
Prompt redirect URL
-browser string
Browser to open AWS Console. Accepted values: firefox, chrome, safari, brave (default "chrome")
-redirect-url string
Redirect URL after login (default "https://<profile_region>.console.aws.amazon.com")