Difference between revisions of "Whoamiaws"
Jump to navigation
Jump to search
(13 intermediate revisions by 2 users not shown) | |||
Line 1: | Line 1: | ||
{{lowercase}} | {{lowercase}} | ||
− | <code>alias whoiamaws="[[aws iam get-user]]"</code> | + | <code>[[alias]] whoiamaws="[[aws iam get-user]]"</code> |
+ | aws iam get-user | ||
+ | { | ||
+ | "User": { | ||
+ | "Path": "/", | ||
+ | "UserName": "your-username", | ||
+ | "UserId": "AIAFETEGKLLQNAFAG", | ||
+ | "Arn": "[[arn:aws:iam]]::1234567890:user/your-username", | ||
+ | "CreateDate": "2022-03-28T15:22:33+00:00" | ||
+ | } | ||
+ | } | ||
+ | |||
+ | == Errors == | ||
+ | aws iam get-user | ||
An error occurred ([[AccessDenied]]) when calling the GetUser operation: User: [[arn:aws:sts]]::0123456789:assumed- role/ROLE_NAME/YOURusername is not authorized to perform: [[iam:GetUser]] on resource: user YOURusername | An error occurred ([[AccessDenied]]) when calling the GetUser operation: User: [[arn:aws:sts]]::0123456789:assumed- role/ROLE_NAME/YOURusername is not authorized to perform: [[iam:GetUser]] on resource: user YOURusername | ||
+ | aws iam get-user | ||
+ | An error occurred ([[ValidationError]]) when calling the [[GetUser]] operation: Must specify [[userName]] when calling with [[non-User credentials]] | ||
+ | |||
+ | aws iam get-user --user-name your-non-existant-user | ||
+ | An error occurred ([[NoSuchEntity]]) when calling the [[GetUser]] operation: The user with name your-non-existant-user cannot be found. | ||
== Related terms == | == Related terms == | ||
Line 13: | Line 31: | ||
* [[Bash: alias]], [[.zprofile]] | * [[Bash: alias]], [[.zprofile]] | ||
* <code>[[aws iam list-account-aliases]]</code> | * <code>[[aws iam list-account-aliases]]</code> | ||
− | * <code>[[aws iam list-attached-user-policies]]</code> | + | * <code>[[aws iam list-attached-user-policies --user-name]]</code> |
* <code>[[AWS_REGION]]</code> | * <code>[[AWS_REGION]]</code> | ||
+ | * <code>[[aws configure get region]]</code> | ||
+ | * [[fish]] | ||
== See also == | == See also == | ||
− | *{{aws | + | * {{aws iam}} |
− | *{{Bash}} | + | * {{Bash}} |
[[Category:Bash]] | [[Category:Bash]] | ||
[[Category:AWS]] | [[Category:AWS]] |
Latest revision as of 10:28, 10 October 2024
alias whoiamaws="aws iam get-user"
aws iam get-user { "User": { "Path": "/", "UserName": "your-username", "UserId": "AIAFETEGKLLQNAFAG", "Arn": "arn:aws:iam::1234567890:user/your-username", "CreateDate": "2022-03-28T15:22:33+00:00" } }
Errors[edit]
aws iam get-user An error occurred (AccessDenied) when calling the GetUser operation: User: arn:aws:sts::0123456789:assumed- role/ROLE_NAME/YOURusername is not authorized to perform: iam:GetUser on resource: user YOURusername
aws iam get-user An error occurred (ValidationError) when calling the GetUser operation: Must specify userName when calling with non-User credentials
aws iam get-user --user-name your-non-existant-user An error occurred (NoSuchEntity) when calling the GetUser operation: The user with name your-non-existant-user cannot be found.
Related terms[edit]
whoami
suaws
awswhoami: aws iam get-user
- Bash: alias, .zprofile
aws iam list-account-aliases
aws iam list-attached-user-policies --user-name
AWS_REGION
aws configure get region
- fish
See also[edit]
aws iam
[create-user
,create-group, get-user
,list-users
|list-policies
|list-attached-user-policies
|attach-user-policy
|list-attached-user-policies
|list-roles
|get-account-summary
|put-group-policy | put-role-policy | put-user-policy
|create-login-profile
|aws iam delete-virtual-mfa-device
|aws iam list-virtual-mfa-devices
|aws iam create-saml-provider
|aws iam list-account-aliases
|aws iam create-role | aws iam change-password| enable-mfa-device | list-instance-profiles
Bash [ -c ]
,alias
,&&
, Bash history, Autocompletion,set
,unset
,export
,.bash_aliases, .bashrc and .bash profile
,PS1
,echo
,brace expansion
, Function,shopt
,trap
,set -e
,source
,PATH
,complete
,disown
,.hushlogin
,.bashrc
,builtin
,eval
,set
,$PATH
,$HOME
,TZ
,.profile
,-e, -i
,Builtin (Bash)
,mapfile
,~
, return (Bash), for, until,declare, dirname, basename, functions.sh
, Bash arithmetic expansion,shift, bash --rcfile, readonly, $1, $@
Advertising: