You only need to call`aws sso login` once for all your profiles

[profile login]
sso_start_url = https://foo.awsapps.com/start
sso_region = us-east-2
[profile AcctA-Role1]
sso_start_url = https://foo.awsapps.com/start
sso_region = us-east-2
sso_account_id = 111122223333
sso_role_name = Role1
$ aws sso login --profile login
Attempting to automatically open the SSO authorization page in your default browser.
If the browser does not open or you wish to use a different device to authorize this request, open the following URL:
https://device.sso.us-east-2.amazonaws.com/
Then enter the code:
XXXX-XXXX
Successfully logged into Start URL: https://foo.awsapps.com/start
$ aws sts get-caller-identity --profile AcctA-Role1
Account: '111122223333'
Arn: arn:aws:sts::111122223333:assumed-role/AWSReservedSSO_Role1_xxx
[profile AcctA-Role1]
sso_start_url = https://foo.awsapps.com/start
sso_region = us-east-2
sso_account_id = 111122223333
sso_role_name = Role1
[profile AcctB-Role2]
sso_start_url = https://foo.awsapps.com/start
sso_region = us-east-2
sso_account_id = 777788889999
sso_role_name = Role2
[profile AcctB-Role1]
sso_start_url = https://foo.awsapps.com/start
sso_region = us-east-2
sso_account_id = 777788889999
sso_role_name = Role1

Cloud Robotics Research Scientist at @iRobot

Love podcasts or audiobooks? Learn on the go with our new app.

Recommended from Medium

PARK VIEW CITY ISLAMABAD ADVANCE DETAILS

park view city islamabad prime location

Learn Dynamic Programming by Solving Knapsack Problem in Java

Serverless Distributed Data Pre-processing using Dask, Amazon ECS and Python (Part 1)

Exploring GitHub Security Alerts

Watch Star Wars in CLI

The Banana and the Gorilla Problem

Flutter: Implement network-aware in your Flutter app

Preserve file names with sorl for better SEO

Get the Medium app

A button that says 'Download on the App Store', and if clicked it will lead you to the iOS App store
A button that says 'Get it on, Google Play', and if clicked it will lead you to the Google Play store
Ben Kehoe

Ben Kehoe

Cloud Robotics Research Scientist at @iRobot

More from Medium

AWS Fargate Explained

Using aws-nuke as a Cleanup and Cost Saving Tool

Github Actions & AWS OIDC

High Available ECS Fargate with Terraform Part-2