Difference between revisions of "Aws sts get-caller-identity"
Jump to navigation
Jump to search
Line 37: | Line 37: | ||
* <code>[[AWS PROFILE]]</code> | * <code>[[AWS PROFILE]]</code> | ||
* <code>[[aws organizations describe-organization]]</code> | * <code>[[aws organizations describe-organization]]</code> | ||
+ | * <code>[[aws iam list-attached-user-policies]]</code> | ||
* <code>[[aws iam get-account-summary]]</code> | * <code>[[aws iam get-account-summary]]</code> | ||
* <code>[[aws iam list-account-aliases]]</code> | * <code>[[aws iam list-account-aliases]]</code> |
Revision as of 10:44, 3 September 2023
aws sts get-caller-identity
command outputs three pieces of information including the ARN.
Contents
Command
aws sts get-caller-identity
aws sts get-caller-identity --profile XXXXX
- ACCOUNT_ID=$(aws sts get-caller-identity --output text --query 'Account')
Examples
aws sts get-caller-identity { "UserId": "ZIDBZCTGOUKVXXFNQ5Q3F", "Account": "09876543212", "Arn": "arn:aws:iam::09876543212:user/your_user" }
{ "UserId": "AROASTNMATSFIGC3RFZFC:martin.oscar", "Account": "09876543212", "Arn": "arn:aws:sts::09876543212:assumed-role/AWSReservedSSO_AdministratorAccess_111111111/your-username" }
Errors
aws sts get-caller-identity Unable to locate credentials. You can configure credentials by running "aws configure".
aws sts get-caller-identity An error ocurred (InvalidClientTokenId) when calling the GetCallerIdentity operation: The security token included in the request is invalid
data.aws_caller_identity.current
Related
AWS PROFILE
aws organizations describe-organization
aws iam list-attached-user-policies
aws iam get-account-summary
aws iam list-account-aliases
aws iam create-account-alias
aws sts get-session-token
aws iam get-user
aws ssm get-instance-profile
- An error occurred (AccessDenied) when calling the ListBuckets operation: Access Denied
aws eks get-token
sts:AssumeRole sts:GetCallerIdentity
See also
Advertising: