loading...

Checking the user information that is being accessed by AWS-CLI

konyu profile image @kon_yu ・1 min read

Checking user information that is being accessed by AWS-CLI

Check which account you're logged in with the command

As you can see below, the credential file shows the access key and the secret key, but it's hard to know what they are.

~/.aws/credentials

[default]
aws_access_key_id=XXXXXXXXXXXXXXXXXX
aws_secret_access_key=XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX

If you run aws sts get-caller-identity, you can determine the identity from the information such as arn.

> aws sts get-caller-identity
{
    "UserId": "XXXXXXXXXXXXX",
    "Account": "1234567890",
    "Arn": "arn:aws:iam::1234567890:user/user-name-1"
}

Discussion

pic
Editor guide