Skip to content

Instantly share code, notes, and snippets.

What would you like to do?
Code snippet to find the account id.
import boto3
client = boto3.client("sts", aws_access_key_id="XXXXXXXX", aws_secret_access_key="XXXXXXXX")
account_id = client.get_caller_identity()["Account"]
print account_id
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment