I am trying to run this command
$ aws iam get-user --query 'User.UserName' --output text
and it failed with
An error occurred (ValidationError) when calling the GetUser operation:
Must specify userName when calling with non-User credentials
I thought it might be due to missing profile, so I added a --profile
parameter.
$ aws --profile dev iam get-user --query 'User.UserName' --output text
It still fails with the same error.
Since I have enabled MFA, is it possible it is due to a mistyped token from the authenicator? If so, can I reset the token?