2
2

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?

More than 5 years have passed since last update.

aws-cliでアクセスしているユーザ情報を確認する

Posted at

aws-cliでアクセスしているユーザ情報を確認する

どのアカウントでログインしているかコマンドで確認する

下記のようにクレデンシャルファイルではアクセスキーとシークレットキーはわかるがこれが何かはわかりにくい

~/.aws/credentials

[default]
aws_access_key_id=XXXXXXXXXXXXXXXX
aws_secret_access_key=XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX

そこでaws sts get-caller-identityを実行すればarnなどの情報から判別することができる

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

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
2
2

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?