Last active
January 1, 2018 22:51
-
-
Save amalgjose/8730192697e2669f847c30e82e696d67 to your computer and use it in GitHub Desktop.
Code snippet to find the account id.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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