aws-cli icon indicating copy to clipboard operation
aws-cli copied to clipboard

No ability to list accounts after initial "aws configure sso"

Open Neven1986 opened this issue 1 month ago • 1 comments

Describe the feature

After going through "aws configure sso" customer is presented with the list of the accounts related to his identity. After customer chooses the account, he proceeds with login into respective account. However, if customer would like to login into another account, he again needs to go through the sequence of "aws configure sso". There doesn't seem to be a way to list the accounts which were retrieved initially during invocation of "aws configure sso"

Use Case

Users should be able to list the accounts retrieved by initial invocation of "aws configure sso". This would ease the changing between accounts, without necessity of going through "aws configure sso" workflow.``

Proposed Solution

Add an option which would list initially retrieved account list when issuing "aws configure sso". eg. aws configure sso list-accounts

Since the list of the assigned accounts could change over time, probably it would make sense to add some purge/timeout parameter in global settings: sso-account-list-expiry=3600

If the command is issued after particular timeout period, return an error message

Other Information

No response

Acknowledgements

  • [ ] I may be able to implement this feature request
  • [ ] This feature might incur a breaking change

CLI version used

2.31.38

Environment details (OS name and version, etc.)

MacOS 15.7.2 (24G325)

Neven1986 avatar Nov 26 '25 12:11 Neven1986

Hello @Neven1986, thanks for reaching out. Have you tried this SSO API that lists all AWS accounts assigned to the user list-accounts?

adev-code avatar Nov 26 '25 18:11 adev-code