Finding AWS Account ID

Ava Chen
Ephod Technology
2 min readAug 17, 2020

--

AWS uses account ID in various places. This is a short reading helping you to identify the place to find your AWS account id and its application in various places. In my case, I was working on pushing a docker image onto AWS Elastic Container Registry (ECR) when I realized I need to locate AWS account id as part of cli.

Account ID on AWS Console

Log into AWS Console, click on My Account.

Account id can be found on the top of the page.

Find Account ID using cli

In order to use aws cli, you will need to install aws command line sdk first. You will need to set up your own aws credential file in ~/.aws/credentials . Click here to get to know more about aws cli sdk.

aws sts get-caller-identity

Find Account ID thru API call

In order to use aws cli, you will need to install aws command line sdk first. You will need to set up your own aws credential file in ~/.aws/credentials . I used Python boto3 library to access aws sts api.

import boto3aws_account_id = boto3.client('sts').get_caller_identity().get('Account')

--

--

Ephod Technology
Ephod Technology

Published in Ephod Technology

We incorporate the strength of both quantitative analysis and fundamental research to bring the best result. We automate SMS trading signals delivery as a result of big data analysis.

Ava Chen
Ava Chen

Written by Ava Chen

The ultimate sophistication is to be true to yourself.

No responses yet