Skip to content

Instantly share code, notes, and snippets.

@amalgjose
Last active January 1, 2018 22:51
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save amalgjose/8730192697e2669f847c30e82e696d67 to your computer and use it in GitHub Desktop.
Save amalgjose/8730192697e2669f847c30e82e696d67 to your computer and use it in GitHub Desktop.
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