DEV Community

@kon_yu
@kon_yu

Posted on

1 2

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)

Billboard image

The Next Generation Developer Platform

Coherence is the first Platform-as-a-Service you can control. Unlike "black-box" platforms that are opinionated about the infra you can deploy, Coherence is powered by CNC, the open-source IaC framework, which offers limitless customization.

Learn more