[AWS CLI] Check which AWS identity the CLI is using

Created on November 30, 2026

You can run aws sts get-caller-identity to check the account and IAM identity associated with your current AWS CLI credentials.

aws sts get-caller-identity

This is an example for an IAM user with JSON output.

{
    "UserId": "AIDAEXAMPLEUSERID1234",
    "Account": "123456789012",
    "Arn": "arn:aws:iam::123456789012:user/Tom"
}

Account is the AWS account ID. The format of UserId and Arn depends on the caller, such as an IAM user or an assumed role.

AWS CLI