How to convert the AWS S3 principalId to user name

Viewed 217
"userIdentity":{  
    "principalId":"Amazon-customer-ID-of-the-user-who-caused-the-event"
 },

How I can convert the principal id, which is available with S3 Event Notification, into the user Name which is responsible for the action?

2 Answers

I couldn't find how to do this either. I ended up sending the sub from user attributes as part of the object key. Then you have access to the sub in the event notification.

It's mind-boggling why the IAM console UI does not show this nor allow for searching.

Have to use the AWS CLI to pull out these info.

aws iam list-users
Related