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

Latium Beta Release is now LIVE!

Automating Jenkins Jobs using Build Pipeline inside Docker Container with the help of Dockerfile

How to Build an Online Community that Rocks!

Using Passwords or Passphrases To Consider Lessons

Supporting Dark themes in Android.

How To Accept All Linkedin Connection Requests At Once ( 100% Working Trick as on 14th May 2020)

Free TON Governance 2.0:

Server side technologies and programming

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

Developing AWS lambda functions + S3 Resources Locally with LocalStack: A Hello World

Github Actions & AWS OIDC

High Available ECS Fargate with Terraform Part-2

A Brief Introduction to AWS Assume Role