Golang SDK: IAM check whether a user is root user name or not programmatically, I am using listusers to get al list of all users

0

In Golang SDK V2 IAM service https://pkg.go.dev/github.com/aws/aws-sdk-go-v2/service/iam How can check whether a user is root user name or not programmatically. I am using listusers to get al list of all users and except for root user I want to do some action.

Also checked "credential reports" that doesn't help

demandé il y a 2 ans319 vues
2 réponses
0

You can use the STS get-caller-identity to see who you are and then make a decision.

profile pictureAWS
EXPERT
kentrad
répondu il y a 2 ans
profile picture
EXPERT
vérifié il y a un mois
  • sts get-caller-identity can only give the identity of the user who calls the api and not for another user.

    some example scenario I am quoting below I am calling the api as user01 and want to know the identity of user890808

0

Any solution available for the problem I had shared?

répondu il y a 2 ans

Vous n'êtes pas connecté. Se connecter pour publier une réponse.

Une bonne réponse répond clairement à la question, contient des commentaires constructifs et encourage le développement professionnel de la personne qui pose la question.

Instructions pour répondre aux questions