Skip to content

Instantly share code, notes, and snippets.

View leopd's full-sized avatar

Leo Dirac leopd

View GitHub Profile
@gene1wood
gene1wood / 01_get_account_id_for_user_ec2instance_role_or_lambda.py
Last active November 9, 2022 16:40
Method to determine your AWS account ID using boto3 for either a user or an ec2 instance or lambda function
import boto3
print(boto3.client('sts').get_caller_identity()['Account'])