DEV Community

@kon_yu
@kon_yu

Posted on

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

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"
}

Top comments (0)