• Skip to main content

Uly.me

cloud engineer

  • Home
  • About
  • Archives

get

AWS Get Access Key Info

June 28, 2022

How to look for an access key in AWS. Find the account.

$ aws sts get-access-key-info --access-key-id AKIA8XXXXXXXXXXXXXXX
{
    "Account": "XXXXXXXXXXXX"
}

$ aws sts get-access-key-info --access-key-id AKIA8XXXXXXXXXXXXXXX { "Account": "XXXXXXXXXXXX" }

Filed Under: Cloud Tagged With: access, account, aws, get, key

AWS Get Account ID

March 6, 2021

Here’s a quick way to find the AWS Account ID via AWS CLI.

aws sts get-caller-identity --query Account --output text

aws sts get-caller-identity --query Account --output text

Output is a 12 digit number (redacted)

xxxxxxxxxxxx

xxxxxxxxxxxx

AWS Account ID is a 12 digit number unique to each AWS account. Occasionally, there are scripts and policies that need the ID of the account. The command above is one way of querying the account ID so they can be used for policies that need them.

Filed Under: Cloud Tagged With: account, aws, cli, get, id

  • Home
  • About
  • Archives

Copyright © 2023