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

已提問 2 年前檢視次數 319 次
2 個答案
0

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

profile pictureAWS
專家
kentrad
已回答 2 年前
profile picture
專家
已審閱 1 個月前
  • 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?

已回答 2 年前

您尚未登入。 登入 去張貼答案。

一個好的回答可以清楚地回答問題並提供建設性的意見回饋,同時有助於提問者的專業成長。

回答問題指南