Role switching configuration - user side

Hello,
I”m planning the creation of a new organization to hold all my users and allow them to switch roles to access my other organizations.
I was wondering if I can use terraform to add the needed entries in the aws dashboard switch role page… configuring each user manually would be a pain…

I could not find anything, so I am probably searching for the wrong term…

Thanks

Switching role requires only the account ID and the IAM role name. If you are looking to create IAM roles in Terraform, you just need to use the aws_iam_role resource and other supporting resources/data sources. Articles like this one from Google search might be of help to you.

However, I wonder if your proposed setup is the best approach. Is it not possible to set up an IDP and hook up all your organizations to it to provide a better SSO experience for both end-users and admins? I also don’t think managing users in Terraform is the best way to go about it.