Run the below command to list all the groups that an IAM user belongs to where username is the name of the user.
aws iam list-groups-for-user --user-name username
Run the below command to list all the groups that an IAM user belongs to where username is the name of the user.
aws iam list-groups-for-user --user-name username