pythonamazon-web-servicesboto3aws-cliaws-sso

AWS SSO - List users assigned with an aws account


I have the list of all AWS accounts in my organization. I need to list the users present in each account via API. Through the documentation List account assigments, I can list only passing as parameters account + permission set. I wanted it to list all users, just like when I click on the account via console, as shown in the image: enter image description here Can anyone tell me if this is possible?


Solution

  • The way I managed to do it was as follows:

    1. List all organization accounts
    2. For each account, list all permission sets
    3. With the account id and permission set, you can list users

    You need to perform this process on all accounts and group users by account. It's a little tedious but it's the only way I found. I hope you can improve this library in the future.