benkehoe / aws-sso-util

Smooth out the rough edges of AWS SSO (temporarily, until AWS makes it better).
Apache License 2.0
973 stars 72 forks source link

"aws-sso-util roles" takes too long #39

Open Shumakriss opened 3 years ago

Shumakriss commented 3 years ago

aws-sso-util roles takes a long time. In my case, 38 seconds for 286 roles.

Can we make it faster?

benkehoe commented 3 years ago

You have to iterate over all available accounts, and iterate over the roles in each account. In theory, it's possible that making the role-getting for a page of accounts concurrent with getting the next page of accounts could speed it up, but it would take some work to handle throttling/retries correctly. In fact, I'd say such a thing for boto3 pagination probably warrants its own library.